Skip to content

Commit

Permalink
Merge pull request #64 from edersoares/dev
Browse files Browse the repository at this point in the history
Improvements
  • Loading branch information
edersoares authored Oct 3, 2024
2 parents 3531d75 + f28716b commit 9219385
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<a href="https://github.com/edersoares/composer-plug-and-play/releases"><img src="https://img.shields.io/github/release/edersoares/composer-plug-and-play.svg?label=latest%20release" alt="Latest Release" /></a>
<a href="https://github.com/edersoares/composer-plug-and-play/blob/master/LICENSE"><img src="https://img.shields.io/github/license/edersoares/composer-plug-and-play" alt="License" /></a>

Add to [Composer](https://getcomposer.org/), a dependency manager for PHP, the ability to plug and play packages without
necessarily installing a new dependency on `composer.json`.
Adds to [Composer](https://getcomposer.org/), PHP's dependency manager, the ability to plug and play packages without necessarily installing
a new dependency on `composer.json`.

## Installation

Expand All @@ -18,8 +18,7 @@ composer require dex/composer-plug-and-play

### Global installation

You can install [Composer Plug and Play](https://github.com/edersoares/composer-plug-and-play/) globally to use its
abilities in all your local projects.
You can install [Composer Plug and Play](https://github.com/edersoares/composer-plug-and-play/) globally to use its abilities in all your local projects.

```bash
composer global require dex/composer-plug-and-play
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"require-dev": {
"composer/composer": "^2.3.0",
"laravel/pint": "^1.7",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-drift": "^2.5"
"pestphp/pest": "^2.34"
},
"autoload": {
"psr-4": {
Expand All @@ -43,7 +42,7 @@
"format": "Format code",
"test": "Runs package tests",
"test:coverage": "Runs coverage",
"test:coverage:open": "Open coverage report"
"test:coverage:open": "Opens coverage report"
},
"config": {
"allow-plugins": {
Expand Down
6 changes: 4 additions & 2 deletions src/Composer/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,16 @@ private function filesystem(): Filesystem

private function experimentalAutoloadStrategy(array $data): void
{
$this->filesystem()->ensureDirectoryExists(PlugAndPlayInterface::PACKAGES_VENDOR . '/' . $data['name']);
$path = PlugAndPlayInterface::PACKAGES_VENDOR . DIRECTORY_SEPARATOR . $data['name'];

$this->filesystem()->ensureDirectoryExists($path);

unset($data['autoload']);
unset($data['autoload-dev']);

$json = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . PHP_EOL;

file_put_contents(PlugAndPlayInterface::PACKAGES_VENDOR . '/' . $data['name'] . '/composer.json', $json);
file_put_contents($path . '/composer.json', $json);
}

/**
Expand Down

0 comments on commit 9219385

Please sign in to comment.