PDepend command not working in CakePHP - composer-php

I am using CakePHP 2.3. And I have installed PDepend through composer.json. Following is code snippet of my composer.json file
"require-dev": {
"phpunit/phpunit": "4.2.*",
"phploc/phploc": "*",
"squizlabs/php_codesniffer": "2.*",
"phpmd/phpmd" : "#stable",
"pdepend/pdepend" : "2.2.4",
"sebastian/phpcpd": "*",
}
"config": {
"vendor-dir": "Vendor/"
}
It is getting installed into Vendor folder of CakePHP folder : app/Vendor/pdepend
If I try to execute pdepend command in my project : pdepend --version then it says : pdepend: command not found
Please help me to resolve this issue

I hope you are using Linux environment. Use below commands.
cd ~/
wget http://static.pdepend.org/php/latest/pdepend.phar
sudo chmod +x pdepend.phar
./pdepend.phar --version
This way you will be able to use pdepend command.
If you want it to make it global command use command below
sudo cp pdepend.phar /usr/bin/pdepend
Now you will be able to use pdepend command anywhere in terminal
Hope this helps.

Related

Update from Laravel 5.5 to 6

I am trying to update the Laravel5.5 project to 6.
What I tried is first describing the package update
"php": "^7.2",
"ext-SimpleXML": "^7.3",
"barryvdh/laravel-ide-helper": "^2.6",
"doctrine/dbal": "^2.10",
"fideloper/proxy": "^4.0",
"jeroennoten/laravel-adminlte": "^2.0",
"laravel/framework": "^6.0",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^6.0",
"maatwebsite/excel": "^3.1",
"laravel/ui": "^1.1",
"phpoffice/phpspreadsheet": "^1.9",
"phpoffice/phpexcel": "dev-master"
next
composer update
I get error
Call to undefined function str_slug()
So install this library
composer require laravel/helpers
Then this error came out
JeroenNoten \ LaravelAdminLte \ ServiceProvider :: class, not found
Reinstalling adminLTE doesn't help, commenting out and reinstalling doesn't work, I'm stuck and want help
I need help
Click here to resolve this error: Call to undefined function str_slug()
Remove space in config/app.php file:
'providers' => [
....
JeroenNoten\LaravelAdminLte\ServiceProvider::class,
],
Just run this command, It can automatically add all configurations to your project:
composer require jeroennoten/laravel-adminlte
More info about jeroennoten/laravel-adminlte
Open the composer.json file of your project (The configuration file of Composer) and change the Laravel framework . (Notice the caret, Laravel 6 makes use of semantic versioning scheme).
you are recommended to first upgrade your project to 5.8 then again upgrade to v6.
Next, save your composer.json file and run the following command:
$ composer update
Before you upgrade your project to v6, make sure your upgrade your PHP version from 7.1 to at least 7.2.
starting from December 2019, PHP 7.1 will not be maintained.

Orchestra testbench could not be found

I have currently a problem with testing a new laravel package. For a better testing environment I would like to use Orchestra's techbench. I follow the whole installation guide. At the moment my PhpStorm IDE could not find the testbench package but it is included in the vendor directory. I guess it's some autoloading problem but I can't find the mistake.
I tried to install the package with:
composer require --dev "orchestra/testbench=^3.5"
composer.json
"require-dev": {
"mockery/mockery": "^1.0#dev",
"phpunit/phpunit": "^6.2|^7.0",
"orchestra/testbench": "~3.5.0",
"orchestra/database": "~3.5.0"
}

Script codecept handling the __exec_command event returned with error code 255

I am very new to unit testing and have been trying to use codeception to do it. So I have followed the following guidelines link
and installed it using composer: composer require "codeception/codeception" --dev, it was successful, but when I tried to set it up using composer exec codecept bootstrap I got the following error:
Script codecept handling the __exec_command event returned with error
code 255
Anyone knows how to fix it?
Just FYI, I have pulled the whole project from a repo that already has the tests/unit folder with previous tests already.
My composer.json file has the following
"require": {
"codeception/robo-paracept": "dev-master",
},
"require-dev": {
"codeception/codeception": "2.6.x-dev",
Apparently the issue was with the php version that I was using. I am using 7.3; using 7.2 solved my problem and the whole thing went smoothly.
Run the command with the -v option to show verbose output.
In my case there where unallowed tabs in my tests/functional.suite.yml file.
I replaced them with 4 spaces and everything was fine.

How to get composer to update version numbers to the latest ones available in composer.json?

In my composer.json config file, I have:
"require": {
"zendframework/zend-log" : "~2.3",
},
"require-dev": {
"phpunit/phpunit": "^5.4"
}
I want:
"require": {
"zendframework/zend-log" : "^2.9",
},
"require-dev": {
"phpunit/phpunit": "^6.2"
}
Note the version number changes
How? I want it to be done automatically without me having to look up each individual latest version that's available and edit it manually.
There is this question but it does not help: How to resolve package not found error when trying to make the composer get the latest package versions?
Run
composer require zendframework/zend-log
and
composer require --dev phpunit/phpunit
Since Composer 2.4, there's a bump command that does exactly that.
Quoted from the release announcement (Jordi Boggiano for Packagist; Aug 2022):
The new bump command lets you increase your requirements to match the versions currently installed. For example, if you require package "foo/bar": "^1" – but you currently have foo/bar 1.5.3 installed – running composer bump foo/bar will update your composer.json requirement to "foo/bar": "^1.5.3".
c.f. "Bumping your version constraints more easily"
For all packages in composer.json, you can do it with the following command (--no-dev):
composer show --no-dev --direct --name-only \
| xargs composer require
And for all developer dependencies:
grep -F -v -f \
<(composer show --direct --no-dev --name-only | sort) \
<(composer show --direct --name-only | sort) \
| xargs composer require --dev
The combination of both commands is similar to what npm-check-updates (ncu) would do for NPM.

composer create-project - command donot work

I have my project on github containing composer.json in the root directory.
This is how my composer.json code looks like:
{
"name": "vendor/projectname",
"description": "My first Composer project",
"authors": [
{
"name": "John Deo",
"email": "johndeo#demo.com"
}
],
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"php": "~5.3"
}
}
I had defined/submited my package on packagist.org.
Now when I try to get the project in my localhost using composer create-project - commands one of its work and another do not work.
1. composer create-project -s dev vendor/projectname >> WORKS
2. composer create-project vendor/projectname >> DO NOT WORK
Can someone please tell why the second command does not work.
What am I missing or doing wrong?
Please Help!
You're missing a stable version of vendor/projectname. In git, a tag (without flag) is a stable version and branches are dev versions. So you have to tag a release (e.g. git tag 1.0.0).

Resources