1 | <?php |
||
22 | class FeedController extends Controller |
||
23 | { |
||
24 | /** |
||
25 | * Feed facade. |
||
26 | * |
||
27 | * @var \Roumen\Feed\Facades\Feed |
||
28 | */ |
||
29 | protected $feed; |
||
30 | |||
31 | /** |
||
32 | * Create a new feed controller instance. |
||
33 | * |
||
34 | * @return void |
||
35 | */ |
||
36 | public function __construct() |
||
44 | |||
45 | /** |
||
46 | * Generates an Atom feed of all issues. |
||
47 | * |
||
48 | * @param \Gitamin\Models\ProjectNamespace|null $namespace |
||
49 | * |
||
50 | * @return \Illuminate\Http\Response |
||
51 | */ |
||
52 | public function atomAction(ProjectNamespace $namespace = null) |
||
56 | |||
57 | /** |
||
58 | * Generates a Rss feed of all issues. |
||
59 | * |
||
60 | * @param \Gitamin\Models\ProjectNamespace|null $group |
||
61 | * |
||
62 | * @return \Illuminate\Http\Response |
||
63 | */ |
||
64 | public function rssAction(ProjectNamespace $namespace = null) |
||
70 | |||
71 | /** |
||
72 | * Generates a feed of all issues. |
||
73 | * |
||
74 | * @param \Gitamin\Models\ProjectNamespace|null $namespace |
||
75 | * @param bool $isRss |
||
76 | * |
||
77 | * @return \Illuminate\Http\Response |
||
78 | */ |
||
79 | private function feedAction(ProjectNamespace &$namespace, $isRss) |
||
95 | |||
96 | /** |
||
97 | * Adds an item to the feed. |
||
98 | * |
||
99 | * @param \Gitamin\Models\Issue $issue |
||
100 | * @param bool $isRss |
||
101 | */ |
||
102 | private function feedAddItem($issue, $isRss) |
||
112 | } |
||
113 |
Let’s assume that you have a directory layout like this:
and let’s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: