Commit cdf165d
authored
Fixed the php-di integration example
The previous version of the example in the README used exceptions that were not imported (NotFoundHttpException) to wrap existing exceptions. I've adapted the example to be similar to the current version of Pecee\SimpleRouter\ClassLoader\ClassLoader. That includes returning strings from loadClassMethod and loadClosure and not wrapping every exception, thrown by the called functions, into NotFoundHttpException exceptions, as well as using the exception ClassNotFoundHttpException when a class cannot be found, instead of the generic NotFoundHttpException. I also changed the way the ClassLoader checks if the container can resolve the class by using the container's method "has" instead of the php function class_exists.1 parent d3b1577 commit cdf165d
1 file changed
+9
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1742 | 1742 | | |
1743 | 1743 | | |
1744 | 1744 | | |
| 1745 | + | |
1745 | 1746 | | |
1746 | 1747 | | |
1747 | 1748 | | |
| |||
1762 | 1763 | | |
1763 | 1764 | | |
1764 | 1765 | | |
1765 | | - | |
| 1766 | + | |
1766 | 1767 | | |
1767 | 1768 | | |
1768 | 1769 | | |
1769 | | - | |
1770 | | - | |
| 1770 | + | |
| 1771 | + | |
1771 | 1772 | | |
1772 | | - | |
1773 | | - | |
1774 | | - | |
1775 | | - | |
1776 | | - | |
1777 | | - | |
| 1773 | + | |
1778 | 1774 | | |
1779 | 1775 | | |
1780 | 1776 | | |
1781 | 1777 | | |
1782 | 1778 | | |
1783 | 1779 | | |
1784 | 1780 | | |
1785 | | - | |
| 1781 | + | |
1786 | 1782 | | |
1787 | 1783 | | |
1788 | 1784 | | |
1789 | | - | |
1790 | | - | |
1791 | | - | |
1792 | | - | |
1793 | | - | |
| 1785 | + | |
1794 | 1786 | | |
1795 | 1787 | | |
1796 | 1788 | | |
1797 | 1789 | | |
1798 | 1790 | | |
1799 | 1791 | | |
1800 | 1792 | | |
1801 | | - | |
| 1793 | + | |
1802 | 1794 | | |
1803 | 1795 | | |
1804 | 1796 | | |
1805 | | - | |
1806 | | - | |
1807 | | - | |
1808 | | - | |
1809 | | - | |
| 1797 | + | |
1810 | 1798 | | |
1811 | 1799 | | |
1812 | 1800 | | |
| |||
0 commit comments