{"action":"created","issue":{"url":"https://api.github.com/repos/timber/timber/issues/1791","repository_url":"https://api.github.com/repos/timber/timber","labels_url":"https://api.github.com/repos/timber/timber/issues/1791/labels{/name}","comments_url":"https://api.github.com/repos/timber/timber/issues/1791/comments","events_url":"https://api.github.com/repos/timber/timber/issues/1791/events","html_url":"https://github.com/timber/timber/pull/1791","id":360793282,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1OTI0NzUx","number":1791,"title":"Add support for path namespaces.","user":{"login":"jenkoian","id":131355,"node_id":"MDQ6VXNlcjEzMTM1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/131355?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkoian","html_url":"https://github.com/jenkoian","followers_url":"https://api.github.com/users/jenkoian/followers","following_url":"https://api.github.com/users/jenkoian/following{/other_user}","gists_url":"https://api.github.com/users/jenkoian/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkoian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkoian/subscriptions","organizations_url":"https://api.github.com/users/jenkoian/orgs","repos_url":"https://api.github.com/users/jenkoian/repos","events_url":"https://api.github.com/users/jenkoian/events{/privacy}","received_events_url":"https://api.github.com/users/jenkoian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-09-17T09:48:04Z","updated_at":"2018-09-19T02:11:28Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/timber/timber/pulls/1791","html_url":"https://github.com/timber/timber/pull/1791","diff_url":"https://github.com/timber/timber/pull/1791.diff","patch_url":"https://github.com/timber/timber/pull/1791.patch"},"body":"#### Issue\r\nWhen looking into timber for a project I'm currently working on, I was looking to make use of path namespaces (e.g. https://symfony.com/doc/current/templating/namespaced_paths.html#registering-your-own-namespaces) but it seems that Timber doesn't currently support this.\r\n\r\n\r\n#### Solution\r\nThis patch introduces support for path namespace, at time of writing only as part of user defined locations, however this could easily be added to to support namespace in theme dirs as well if you wanted.\r\n\r\n\r\n#### Impact\r\nIt should be backwards compatible, so it shouldn't have any negative impact on existing users.\r\n\r\n\r\n#### Usage Changes\r\nUsers who wish to make use of path namespaces can now do so, e.g. with a styleguide namespace\r\n\r\n```php\r\nTimber::$locations = array(\r\n    '/Users/jared/Sandbox/templates',\r\n    '~/Sites/timber-templates/',\r\n    ABSPATH.'/wp-content/templates',\r\n    'styleguide' => ABSPATCH.'/wp-content/styleguide'\r\n);\r\n```\r\n\r\n\r\n#### Considerations\r\nI've not spent too much time on this patch, I'm hoping for some guidance/advice if there are any edge cases I may not have considered as I am very new to this library.\r\n\r\nIt's also worth noting that I've just checked for a namespace presence and ignored if none there, but we could easily change to give each location the default namespace (`__MAIN__`) if none is configured, to cut down on an if statement.\r\n\r\n\r\n#### Testing\r\nI included one basic unit test, but would be happy to add more if you think this patch is worth including. \r\n"},"comment":{"url":"https://api.github.com/repos/timber/timber/issues/comments/422623527","html_url":"https://github.com/timber/timber/pull/1791#issuecomment-422623527","issue_url":"https://api.github.com/repos/timber/timber/issues/1791","id":422623527,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjYyMzUyNw==","user":{"login":"codecov[bot]","id":22429695,"node_id":"MDM6Qm90MjI0Mjk2OTU=","avatar_url":"https://avatars2.githubusercontent.com/in/254?v=4","gravatar_id":"","url":"https://api.github.com/users/codecov%5Bbot%5D","html_url":"https://github.com/apps/codecov","followers_url":"https://api.github.com/users/codecov%5Bbot%5D/followers","following_url":"https://api.github.com/users/codecov%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/codecov%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/codecov%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codecov%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/codecov%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/codecov%5Bbot%5D/repos","events_url":"https://api.github.com/users/codecov%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/codecov%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-09-19T02:11:28Z","updated_at":"2018-09-19T02:11:28Z","author_association":"NONE","body":"# [Codecov](https://codecov.io/gh/timber/timber/pull/1791?src=pr&el=h1) Report\n> Merging [#1791](https://codecov.io/gh/timber/timber/pull/1791?src=pr&el=desc) into [master](https://codecov.io/gh/timber/timber/commit/fae59773b642221e716ce8381c8f1973553189bc?src=pr&el=desc) will **increase** coverage by `<.01%`.\n> The diff coverage is `100%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/timber/timber/pull/1791/graphs/tree.svg?width=650&token=IyLi4G63E8&height=150&src=pr)](https://codecov.io/gh/timber/timber/pull/1791?src=pr&el=tree)\n\n```diff\n@@             Coverage Diff              @@\n##             master    #1791      +/-   ##\n============================================\n+ Coverage     94.83%   94.84%   +<.01%     \n- Complexity     1527     1530       +3     \n============================================\n  Files            48       48              \n  Lines          3585     3591       +6     \n============================================\n+ Hits           3400     3406       +6     \n  Misses          185      185\n```\n\n\n| [Impacted Files](https://codecov.io/gh/timber/timber/pull/1791?src=pr&el=tree) | Coverage Δ | Complexity Δ | |\n|---|---|---|---|\n| [lib/Loader.php](https://codecov.io/gh/timber/timber/pull/1791/diff?src=pr&el=tree#diff-bGliL0xvYWRlci5waHA=) | `96.25% <100%> (+0.09%)` | `68 <0> (+2)` | :arrow_up: |\n| [lib/LocationManager.php](https://codecov.io/gh/timber/timber/pull/1791/diff?src=pr&el=tree#diff-bGliL0xvY2F0aW9uTWFuYWdlci5waHA=) | `100% <100%> (ø)` | `26 <0> (+1)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/timber/timber/pull/1791?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/timber/timber/pull/1791?src=pr&el=footer). Last update [fae5977...1185b9c](https://codecov.io/gh/timber/timber/pull/1791?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"}}
{"actor":{"display_login":"codecov"}}