{"action":"created","comment":{"url":"https://api.github.com/repos/PHPers/faq/pulls/comments/32061820","id":32061820,"diff_hunk":"@@ -126,7 +126,58 @@\n \t\t\t\t</p>\n \t\t\t</div> <!-- cd-faq-content -->\n \t\t</li>\n-\t</ul> <!-- cd-faq-group -->\n+\t</ul> \n+        <ul id=\"frameworki\" class=\"cd-faq-group\">\n+                <li class=\"cd-faq-title\"><h2>Frameworki</h2></li>\n+                <li>\n+                        <a class=\"cd-faq-trigger\" href=\"#0\">Dlaczego hejtujemy Laravela?</a>\n+                        <div class=\"cd-faq-content\">\n+                                <p>\n+                                        Ja, piszący te słowa, pracowałem przez dwa miesiące z Laravelem i mója do niego niechęć nie opiera się na zawiści wobec Taylora Otwella.\n+                                </p>\n+                                <p>\n+                                        Laravel używa biblioteki o nazwie Eloquent, która ma być ORM, a tak naprawdę jest to Active Record. Doświadczenia z Eloquentem mam następujące:\n+                                        </p>\n+                                        <ol>\n+                                                <li>Z niezrozumiałych dla mnie przyczyn dostępne są dwa query buildery: użycie <a href=\"https://github.com/laravel/framework/blob/v5.0.32/src/Illuminate/Database/Eloquent/Builder.php\">pierwszego z nich</a> powoduje zwrócenie obiektów AR, natomiast <a href=\"https://github.com/laravel/framework/blob/v5.0.32/src/Illuminate/Database/Query/Builder.php\">drugi</a> zwraca tablice. Jeśli bliżej przyjrzycie się budowie Eloquent\\Builder, to zauważycie, że Query\\Builder jest do niego wstrzyknięty, a magiczna metoda __call() powoduje wywoływanie metod nieistniejących w Eloquent\\Builder na Query\\Builder. Miłego debugowania.</li>\n+                                                <li>Jeśli używasz Eloquent\\Builder, to raczej wcześniej niż później będziesz klasę rozszerzał tak, by umożliwiała np. filtrowanie po doJOINowanych tabelach. Bo przecież będziesz oczekiwał, że zwróci ona obiekt AR, a nie tablicę. Prawda? <a href=\"https://www.facebook.com/groups/laravelpolska/permalink/1587069624864733/\">Dyskusja</a>.</li>\n+                                                <li>Wołająć na obiekcie AR metodę <a href=\"https://github.com/laravel/framework/blob/v5.0.32/src/Illuminate/Database/Eloquent/Model.php#L1460\">save()</a> jesteśmy dość kulturalnie informowani o tym, że operacja się nie powiodła. Używając metody <a href=\"https://github.com/laravel/framework/blob/v5.0.32/src/Illuminate/Database/Eloquent/Model.php#L525\">create()</a> jesteśmy informowani nieco mniej kulturalnie (<a href=\"https://github.com/laravel/framework/blob/v5.0.32/src/Illuminate/Database/Eloquent/Model.php#L175\">ale za to publicznie</a>). Gorzej, że niepowodzenie w żadnym z tych przypadków nie spowoduje przerwania transakcji (bo jej tam zwyczajnie nie ma, bez względu na to jaka baza jest pod spodem). Nieco nieaktualna - bo na temat wersji 4 - <a href=\"https://www.facebook.com/groups/223889134481096/permalink/336420516561290/\">dyskusja</a>.</li>\n+                                        </ol>\n+                                <p>\n+                                        Stanowczo nadużywane jest słowo kluczowe static:\n+                                </p>\n+                                        <ol>\n+\n+                                                <li>Fasady. Dostęp statyczny, to niestety jest zło. Oczywiście można sobie z nim poradzić i nadal pisać testy! Pod warunkime, że w <a href=\"https://github.com/laravel/framework/blob/v5.0.32/src/Illuminate/Support/Facades/Facade.php\">produkcyjnym kodzie</a> znajdą się metody służące wyłącznie testowaniu</li>\n+                                                <li>Dependency Injection kontra Fasady - w Laravelu znajduje się dość sensowny moduł odpowiedzialny za DI. Nie mam do niego zastrzeżeń, naprawdę. W większości przypadków programiści korzystają z nieszczęsnych fasad, które powodują, że: DI zastępujemy Service Locatorem i nie mamy bladego pojęcia o tym jakie są prawdziwe zależności naszej klasy.</li>\n+                                                <li>Do zapisywania obiektu AR do bazy służy, a jakże, <a href=\"https://github.com/laravel/framework/blob/v5.0.32/src/Illuminate/Database/Eloquent/Model.php#L1185\">statyczna metoda save()</a>. Teraz idź córko (bądź synu) i napisz test do fragmentu kodu, który tworzy obiekt AR i zapisuje go do bazy. Miłego moczenia statyków...</li>\n+                                                <li>Statyków jest więcej. Bo przecież klasa wykonująca <a href=\"https://github.com/laravel/framework/blob/v5.0.32/src/Illuminate/Support/Str.php\">operacje na ciągach znaków</a> jest tylko kontenerem do przechowywania funkcji.</li>\n+                                        </ol>\n+                                <p>\n+                                        Nadużywanie metod magicznych:\n+                                </p>\n+                                        <ol>\n+                                                <li>Wspomniane wyżej połączenie dwóch query builderów.</li>\n+                                                <li><a href=\"https://github.com/laravel/framework/blob/v5.0.32/src/Illuminate/Auth/AuthManager.php\">AuthManager</a> również pozwala nam wykonywać <a href=\"https://github.com/laravel/framework/blob/v5.0.32/src/Illuminate/Support/Manager.php#L137\">zgoła nieoczekiwane operacje</a> na <a href=\"http://laravel.com/docs/5.0/authentication#retrieving-the-authenticated-user\">obiektach</a>, o których nie mamy większego pojęcia. <a href=\"\">Dyskusja</a> (dotyczyła wersji 4.2, ale wygląda na to, że nadal jest aktualna)</li>\n+                                                <li>Mockowanie tych szalonych zależności wymaga intensywnego korzystania z xdebuga.</li>\n+\n+                                        </ol>\n+                                <p>\n+                                        Występują też w przyrodzie zjawiska, których po prostu nie rozumiem:\n+                                </p>\n+                                        <ol>\n+                                                <li>Packagist laravelish enough is not! W związku z czym istenieje <a href=\"http://packalyst.com/\">Packalyst</a></li>\n+                                        </ol>\n+                                <p>\n+                                Dlaczego w takim razie ktoś w ogóle używa Laravela? Z bardzo prostej przyczyny - Otwell zapewnia projektowi fenomenalny wręcz marketing, próg wejścia jest w zasadzie zerowy (najwyżej opakujesz kod proceduralny w statyczne metody), a do tego czas nas czasem goni... Co zrobić? Jak żyć? Nie używać Laravela do żadnych projektów, które potem będą musiały być przez dłuższy czas utrzymywane. Twoim celem jest zwiększenie sprzedaży piwa marki X w wakacje, wśród studentów? Zastanów się nad tym, czy nie byłoby warto użyć <a href=\"http://silex.sensiolabs.org/\">Silexa</a> albo <a href=\"http://www.slimframework.com/\">Slima</a>, a jeśli nie chcesz bądź po prostu musisz - to piszże w Laravelu.<br>\n+                                Nigdy, przenigdy, nie używaj Laravela do projektów, które będą miały być utrzymywane przez wiele lat. Słaba architektura Cię wykończy zanim zdąży Cię wykończyć brak dobrych testów jednostkowych.","path":"index.html","position":58,"original_position":58,"commit_id":"14b873f450da9a72e85fdb557ab2d86b8b95f756","original_commit_id":"f5afb0b5130caa15eddad2ac7b4ef52f904ccfc4","user":{"login":"iwankgb","id":939646,"avatar_url":"https://avatars.githubusercontent.com/u/939646?v=3","gravatar_id":"","url":"https://api.github.com/users/iwankgb","html_url":"https://github.com/iwankgb","followers_url":"https://api.github.com/users/iwankgb/followers","following_url":"https://api.github.com/users/iwankgb/following{/other_user}","gists_url":"https://api.github.com/users/iwankgb/gists{/gist_id}","starred_url":"https://api.github.com/users/iwankgb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwankgb/subscriptions","organizations_url":"https://api.github.com/users/iwankgb/orgs","repos_url":"https://api.github.com/users/iwankgb/repos","events_url":"https://api.github.com/users/iwankgb/events{/privacy}","received_events_url":"https://api.github.com/users/iwankgb/received_events","type":"User","site_admin":false},"body":"Zapraszam serdecznie do przedstawienia wniosków innych członków społeczności. Na tyle konkretnych, że da się je ubrać w formę PR.\r\nZ resztą Twojej wypowiedzi się nie zgadzam.","created_at":"2015-06-09T20:46:17Z","updated_at":"2015-06-09T20:46:17Z","html_url":"https://github.com/PHPers/faq/pull/10#discussion_r32061820","pull_request_url":"https://api.github.com/repos/PHPers/faq/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/PHPers/faq/pulls/comments/32061820"},"html":{"href":"https://github.com/PHPers/faq/pull/10#discussion_r32061820"},"pull_request":{"href":"https://api.github.com/repos/PHPers/faq/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/PHPers/faq/pulls/10","id":37287961,"html_url":"https://github.com/PHPers/faq/pull/10","diff_url":"https://github.com/PHPers/faq/pull/10.diff","patch_url":"https://github.com/PHPers/faq/pull/10.patch","issue_url":"https://api.github.com/repos/PHPers/faq/issues/10","number":10,"state":"open","locked":false,"title":"Dlaczego laravel jest do rzyci","user":{"login":"iwankgb","id":939646,"avatar_url":"https://avatars.githubusercontent.com/u/939646?v=3","gravatar_id":"","url":"https://api.github.com/users/iwankgb","html_url":"https://github.com/iwankgb","followers_url":"https://api.github.com/users/iwankgb/followers","following_url":"https://api.github.com/users/iwankgb/following{/other_user}","gists_url":"https://api.github.com/users/iwankgb/gists{/gist_id}","starred_url":"https://api.github.com/users/iwankgb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwankgb/subscriptions","organizations_url":"https://api.github.com/users/iwankgb/orgs","repos_url":"https://api.github.com/users/iwankgb/repos","events_url":"https://api.github.com/users/iwankgb/events{/privacy}","received_events_url":"https://api.github.com/users/iwankgb/received_events","type":"User","site_admin":false},"body":"Zgodnie z prośbą, którą Leszek złożył na fejsie: oto i pull request do PHPersowego FAQ tłumaczący dlaczego Laravel to zło.","created_at":"2015-06-09T19:08:13Z","updated_at":"2015-06-09T20:46:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8631713179127146ad08d671e50acc17298b1f8e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PHPers/faq/pulls/10/commits","review_comments_url":"https://api.github.com/repos/PHPers/faq/pulls/10/comments","review_comment_url":"https://api.github.com/repos/PHPers/faq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PHPers/faq/issues/10/comments","statuses_url":"https://api.github.com/repos/PHPers/faq/statuses/14b873f450da9a72e85fdb557ab2d86b8b95f756","head":{"label":"iwankgb:dlaczego_laravel_jest_do_rzyci","ref":"dlaczego_laravel_jest_do_rzyci","sha":"14b873f450da9a72e85fdb557ab2d86b8b95f756","user":{"login":"iwankgb","id":939646,"avatar_url":"https://avatars.githubusercontent.com/u/939646?v=3","gravatar_id":"","url":"https://api.github.com/users/iwankgb","html_url":"https://github.com/iwankgb","followers_url":"https://api.github.com/users/iwankgb/followers","following_url":"https://api.github.com/users/iwankgb/following{/other_user}","gists_url":"https://api.github.com/users/iwankgb/gists{/gist_id}","starred_url":"https://api.github.com/users/iwankgb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwankgb/subscriptions","organizations_url":"https://api.github.com/users/iwankgb/orgs","repos_url":"https://api.github.com/users/iwankgb/repos","events_url":"https://api.github.com/users/iwankgb/events{/privacy}","received_events_url":"https://api.github.com/users/iwankgb/received_events","type":"User","site_admin":false},"repo":{"id":36893499,"name":"faq","full_name":"iwankgb/faq","owner":{"login":"iwankgb","id":939646,"avatar_url":"https://avatars.githubusercontent.com/u/939646?v=3","gravatar_id":"","url":"https://api.github.com/users/iwankgb","html_url":"https://github.com/iwankgb","followers_url":"https://api.github.com/users/iwankgb/followers","following_url":"https://api.github.com/users/iwankgb/following{/other_user}","gists_url":"https://api.github.com/users/iwankgb/gists{/gist_id}","starred_url":"https://api.github.com/users/iwankgb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwankgb/subscriptions","organizations_url":"https://api.github.com/users/iwankgb/orgs","repos_url":"https://api.github.com/users/iwankgb/repos","events_url":"https://api.github.com/users/iwankgb/events{/privacy}","received_events_url":"https://api.github.com/users/iwankgb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iwankgb/faq","description":"FAQ dla grup PHPers","fork":true,"url":"https://api.github.com/repos/iwankgb/faq","forks_url":"https://api.github.com/repos/iwankgb/faq/forks","keys_url":"https://api.github.com/repos/iwankgb/faq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iwankgb/faq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iwankgb/faq/teams","hooks_url":"https://api.github.com/repos/iwankgb/faq/hooks","issue_events_url":"https://api.github.com/repos/iwankgb/faq/issues/events{/number}","events_url":"https://api.github.com/repos/iwankgb/faq/events","assignees_url":"https://api.github.com/repos/iwankgb/faq/assignees{/user}","branches_url":"https://api.github.com/repos/iwankgb/faq/branches{/branch}","tags_url":"https://api.github.com/repos/iwankgb/faq/tags","blobs_url":"https://api.github.com/repos/iwankgb/faq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iwankgb/faq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iwankgb/faq/git/refs{/sha}","trees_url":"https://api.github.com/repos/iwankgb/faq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iwankgb/faq/statuses/{sha}","languages_url":"https://api.github.com/repos/iwankgb/faq/languages","stargazers_url":"https://api.github.com/repos/iwankgb/faq/stargazers","contributors_url":"https://api.github.com/repos/iwankgb/faq/contributors","subscribers_url":"https://api.github.com/repos/iwankgb/faq/subscribers","subscription_url":"https://api.github.com/repos/iwankgb/faq/subscription","commits_url":"https://api.github.com/repos/iwankgb/faq/commits{/sha}","git_commits_url":"https://api.github.com/repos/iwankgb/faq/git/commits{/sha}","comments_url":"https://api.github.com/repos/iwankgb/faq/comments{/number}","issue_comment_url":"https://api.github.com/repos/iwankgb/faq/issues/comments{/number}","contents_url":"https://api.github.com/repos/iwankgb/faq/contents/{+path}","compare_url":"https://api.github.com/repos/iwankgb/faq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iwankgb/faq/merges","archive_url":"https://api.github.com/repos/iwankgb/faq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iwankgb/faq/downloads","issues_url":"https://api.github.com/repos/iwankgb/faq/issues{/number}","pulls_url":"https://api.github.com/repos/iwankgb/faq/pulls{/number}","milestones_url":"https://api.github.com/repos/iwankgb/faq/milestones{/number}","notifications_url":"https://api.github.com/repos/iwankgb/faq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iwankgb/faq/labels{/name}","releases_url":"https://api.github.com/repos/iwankgb/faq/releases{/id}","created_at":"2015-06-04T20:23:40Z","updated_at":"2015-06-04T20:23:40Z","pushed_at":"2015-06-09T20:29:20Z","git_url":"git://github.com/iwankgb/faq.git","ssh_url":"git@github.com:iwankgb/faq.git","clone_url":"https://github.com/iwankgb/faq.git","svn_url":"https://github.com/iwankgb/faq","homepage":null,"size":222,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"PHPers:gh-pages","ref":"gh-pages","sha":"f5ebdf7dfdd6fcb9ec333068db0d6eecb37b2a13","user":{"login":"PHPers","id":6490008,"avatar_url":"https://avatars.githubusercontent.com/u/6490008?v=3","gravatar_id":"","url":"https://api.github.com/users/PHPers","html_url":"https://github.com/PHPers","followers_url":"https://api.github.com/users/PHPers/followers","following_url":"https://api.github.com/users/PHPers/following{/other_user}","gists_url":"https://api.github.com/users/PHPers/gists{/gist_id}","starred_url":"https://api.github.com/users/PHPers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PHPers/subscriptions","organizations_url":"https://api.github.com/users/PHPers/orgs","repos_url":"https://api.github.com/users/PHPers/repos","events_url":"https://api.github.com/users/PHPers/events{/privacy}","received_events_url":"https://api.github.com/users/PHPers/received_events","type":"Organization","site_admin":false},"repo":{"id":30555342,"name":"faq","full_name":"PHPers/faq","owner":{"login":"PHPers","id":6490008,"avatar_url":"https://avatars.githubusercontent.com/u/6490008?v=3","gravatar_id":"","url":"https://api.github.com/users/PHPers","html_url":"https://github.com/PHPers","followers_url":"https://api.github.com/users/PHPers/followers","following_url":"https://api.github.com/users/PHPers/following{/other_user}","gists_url":"https://api.github.com/users/PHPers/gists{/gist_id}","starred_url":"https://api.github.com/users/PHPers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PHPers/subscriptions","organizations_url":"https://api.github.com/users/PHPers/orgs","repos_url":"https://api.github.com/users/PHPers/repos","events_url":"https://api.github.com/users/PHPers/events{/privacy}","received_events_url":"https://api.github.com/users/PHPers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PHPers/faq","description":"FAQ dla grup PHPers","fork":false,"url":"https://api.github.com/repos/PHPers/faq","forks_url":"https://api.github.com/repos/PHPers/faq/forks","keys_url":"https://api.github.com/repos/PHPers/faq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PHPers/faq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PHPers/faq/teams","hooks_url":"https://api.github.com/repos/PHPers/faq/hooks","issue_events_url":"https://api.github.com/repos/PHPers/faq/issues/events{/number}","events_url":"https://api.github.com/repos/PHPers/faq/events","assignees_url":"https://api.github.com/repos/PHPers/faq/assignees{/user}","branches_url":"https://api.github.com/repos/PHPers/faq/branches{/branch}","tags_url":"https://api.github.com/repos/PHPers/faq/tags","blobs_url":"https://api.github.com/repos/PHPers/faq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PHPers/faq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PHPers/faq/git/refs{/sha}","trees_url":"https://api.github.com/repos/PHPers/faq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PHPers/faq/statuses/{sha}","languages_url":"https://api.github.com/repos/PHPers/faq/languages","stargazers_url":"https://api.github.com/repos/PHPers/faq/stargazers","contributors_url":"https://api.github.com/repos/PHPers/faq/contributors","subscribers_url":"https://api.github.com/repos/PHPers/faq/subscribers","subscription_url":"https://api.github.com/repos/PHPers/faq/subscription","commits_url":"https://api.github.com/repos/PHPers/faq/commits{/sha}","git_commits_url":"https://api.github.com/repos/PHPers/faq/git/commits{/sha}","comments_url":"https://api.github.com/repos/PHPers/faq/comments{/number}","issue_comment_url":"https://api.github.com/repos/PHPers/faq/issues/comments{/number}","contents_url":"https://api.github.com/repos/PHPers/faq/contents/{+path}","compare_url":"https://api.github.com/repos/PHPers/faq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PHPers/faq/merges","archive_url":"https://api.github.com/repos/PHPers/faq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PHPers/faq/downloads","issues_url":"https://api.github.com/repos/PHPers/faq/issues{/number}","pulls_url":"https://api.github.com/repos/PHPers/faq/pulls{/number}","milestones_url":"https://api.github.com/repos/PHPers/faq/milestones{/number}","notifications_url":"https://api.github.com/repos/PHPers/faq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PHPers/faq/labels{/name}","releases_url":"https://api.github.com/repos/PHPers/faq/releases{/id}","created_at":"2015-02-09T19:58:22Z","updated_at":"2015-06-09T19:59:57Z","pushed_at":"2015-06-09T20:29:21Z","git_url":"git://github.com/PHPers/faq.git","ssh_url":"git@github.com:PHPers/faq.git","clone_url":"https://github.com/PHPers/faq.git","svn_url":"https://github.com/PHPers/faq","homepage":null,"size":347,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":5,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/PHPers/faq/pulls/10"},"html":{"href":"https://github.com/PHPers/faq/pull/10"},"issue":{"href":"https://api.github.com/repos/PHPers/faq/issues/10"},"comments":{"href":"https://api.github.com/repos/PHPers/faq/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/PHPers/faq/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/PHPers/faq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PHPers/faq/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/PHPers/faq/statuses/14b873f450da9a72e85fdb557ab2d86b8b95f756"}}}}