psr-4 Questions

2

I'm just getting started using composer for dependency management and I'm having a hard time figuring out how I'm not adhering to psr-4 for autoloading so I'm here for advice. I've got a class that...
Elga asked 24/6, 2014 at 17:26

2

Solved

PhpStorm is highlighting the following namespace as an error. <?php namespace App\Http\Controllers\Public; Error: Expected: identifier In general. Are reserved keywords like public, functi...
Gravois asked 27/5, 2017 at 17:15

7

Solved

I understand that you can use either a PSR standard to locate files, or tell composer a directory to scan for classes. The documentation recommends using the PSR-4 standard. There is also an option...
Bade asked 2/4, 2014 at 6:42

5

Solved

I was trying to go live with a laravel project i developped a year back in school and i ran into some issue. After uploading the whole project on my hosting service's server, i got these errors on ...
Rubicund asked 12/8, 2016 at 13:17

2

I am developing a web application using PhpStorm on OSx. I'm using Composer and have PSR-4 autoloading configured in composer.json. Everything is working fine on my development machine, but autoloa...
Secondly asked 28/2, 2017 at 16:2

3

Solved

I'm trying to setup PSR-4 with Composer but I'm just getting A non-empty PSR-4 prefix must end with a namespace separator. My autoload in my composer.json looks like this: "autoload": { "psr-4":...
Hydrocephalus asked 30/1, 2014 at 17:29

1

I try to use composer autoload but I get this error composer.json { "autoload":{ "psr-4":{ "App\\":"app/" }, "files": ["app/functio...
Uruguay asked 27/11, 2020 at 13:59

2

Solved

I have a Laravel project that works fine locally (Mavericks), but classes under psr-4 aren't loading on our stage server (CentOS). I'm getting a Reflection "class not found" error every time I try ...
Puglia asked 26/8, 2014 at 6:46

1

Solved

I am creating a PHP project and want to implement PSR-4 autoloading. I don't know which files I need to create in the vendor directory to implement autoloading for class files.
Stiltner asked 29/3, 2020 at 18:23

1

Solved

I'm working on a simple project using PHP and I'm using PSR-4 autoloading. I just wonder if there's a way to run composer dump-autoload -o on composer install, so that new users won't need to type ...
Silver asked 5/1, 2019 at 19:30

2

Solved

I have my own little MVC framework and I use composer psr-4 autoloading. On my own computer it works perfectly fine, but when I deployed it to my Ubuntu server it did not work anymore. (it doesn't...
Nightspot asked 15/1, 2018 at 2:56

2

Solved

I have a set of PHP functions that I find useful. I want to create a PSR-4 compliant repository for them, but the guides I have found (1,2,3) seem to talk only about classes for autoloading. For ...
Shutdown asked 7/9, 2015 at 17:6

5

Solved

Recently I've read about namespaces and how they are beneficial. I'm currently creating a project in Laravel and trying to move from class map autoloading to namespacing. However, I can't seem to g...
Araiza asked 21/7, 2014 at 15:12

2

Solved

I have one directory that is going to keep all "helper" classes and functions. Let's call the directory helpers. I want to configure PSR-4 fallback directory to point to this helpers directory: ...
Sensor asked 14/2, 2018 at 17:28

1

Solved

On Composer's autoload optimization page: Note: You should not enable any of these optimizations in development as they all will cause various problems when adding/removing classes. The performa...
Sacramentalist asked 26/4, 2018 at 5:17

2

Solved

I currently follow PSR-2 and PSR-4. I'm running into a small dilemma when trying to name a few classes. Here's an example. I have a base REST client, \Vendor\RestClient\AbstractClient. I have two ...
Retractor asked 18/12, 2015 at 16:20

2

Solved

I am giving composer autoload a try with some phpunit testing classes, and I can't seem to get it to work. When I run phpunit from the command line, I get the following error : "PHP Fatal Error: Cl...
Sixtieth asked 25/8, 2016 at 20:56

1

Solved

I have been beating my head for a couple hours trying to figure out why the autoload is not working for "Authentication\auth()". The "dBase\db()" class is loading just fine, but i'm getting: Err...
Caz asked 19/12, 2017 at 1:14

5

I'm currently working on a Laravel project that needs to access classes from its parent directory. composer.json > PSR-4: "psr-4": { ... "ModuleA\\": "../ModuleA/baseObjects", "ModuleB\\": "....
Yt asked 7/7, 2017 at 9:17

3

Solved

I'm a little confused with how I should be using psr-4 autoloading in Composer. Let's say I've got a folder structure like this: / |- Core/ | - Router.php |- App/ | - Models | User.php |- composer...
Clementclementas asked 22/3, 2016 at 15:43

3

I'm trying to test a function in phpspec which calls Laravel's Validator::make function (http://laravel.com/docs/4.2/validation) However, I'm trying to call that same function from a namespace whe...
Whitefish asked 15/1, 2015 at 22:9

2

Solved

I want to use Checkout SDK with Yii2 but since this library does not support PSR-4 standards (namespaces) I am having trouble to integrate it. How can I use this library for my purpose? EDIT As ...
Rhynchocephalian asked 24/1, 2015 at 17:18

1

Solved

I need to dump my autoloader every time I add a new class. I am using psr-4. I don't really know why I need to do so. In psr-4 it should automatically load the classes. Where am I going wrong? Her...
Moralize asked 21/1, 2017 at 20:54

1

Solved

In regards to Laravel, I got a question about Composer autoloading i.e. the difference between "psr-4" and "classmap" autoloading. 1 difference that I know is PSR-4 does not need repeated dumpauto...
Glomma asked 31/7, 2016 at 16:37

1

Im using Codeception in Yii2 to make acceptance tests and there's no way to access my models because namespaces are not working into these tests. I have this in my tests/_bootstrap.php require(_...
Evangelistic asked 16/4, 2015 at 16:56

© 2022 - 2024 — McMap. All rights reserved.