Skip to content

Renamed namespace #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Changed

- BC-Break: The top-level namespace for all classes has changed from `JakubOnderka` to `PHP_Parallel_Lint`. [#10](https://github.com/php-parallel-lint/PHP-Console-Color/pull/10) from [@grogy](https://github.com/grogy).

### Added

- Added downloading per month badge from [@grogy](https://github.com/grogy).
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
}
],
"autoload": {
"psr-4": {"JakubOnderka\\PhpConsoleColor\\": "src/"}
"psr-4": {"PHP_Parallel_Lint\\PhpConsoleColor\\": "src/"}
},
"autoload-dev": {
"psr-4": {"PHP_Parallel_Lint\\PhpConsoleColor\\Test\\": "tests/"}
},
"require": {
"php": ">=5.4.0"
Expand Down
2 changes: 1 addition & 1 deletion example.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
$loader = require_once __DIR__ . '/vendor/autoload.php';

$consoleColor = new JakubOnderka\PhpConsoleColor\ConsoleColor();
$consoleColor = new PHP_Parallel_Lint\PhpConsoleColor\ConsoleColor();

echo "Colors are supported: " . ($consoleColor->isSupported() ? 'Yes' : 'No') . "\n";
echo "256 colors are supported: " . ($consoleColor->are256ColorsSupported() ? 'Yes' : 'No') . "\n\n";
Expand Down
2 changes: 1 addition & 1 deletion src/ConsoleColor.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace JakubOnderka\PhpConsoleColor;
namespace PHP_Parallel_Lint\PhpConsoleColor;

class ConsoleColor
{
Expand Down
2 changes: 1 addition & 1 deletion src/InvalidStyleException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace JakubOnderka\PhpConsoleColor;
namespace PHP_Parallel_Lint\PhpConsoleColor;

class InvalidStyleException extends \Exception
{
Expand Down
12 changes: 7 additions & 5 deletions tests/ConsoleColorTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
use JakubOnderka\PhpConsoleColor\ConsoleColor;
namespace PHP_Parallel_Lint\PhpConsoleColor\Test;

use PHP_Parallel_Lint\PhpConsoleColor\ConsoleColor;
use PHPUnit\Framework\TestCase;

class ConsoleColorWithForceSupport extends ConsoleColor
Expand Down Expand Up @@ -148,24 +150,24 @@ public function testHasAndRemoveTheme()
public function testApplyInvalidArgument()
{
$this->exceptionHelper('\InvalidArgumentException');
$this->uut->apply(new stdClass(), 'text');
$this->uut->apply(new \stdClass(), 'text');
}

public function testApplyInvalidStyleName()
{
$this->exceptionHelper('\JakubOnderka\PhpConsoleColor\InvalidStyleException');
$this->exceptionHelper('\PHP_Parallel_Lint\PhpConsoleColor\InvalidStyleException');
$this->uut->apply('invalid', 'text');
}

public function testApplyInvalid256Color()
{
$this->exceptionHelper('\JakubOnderka\PhpConsoleColor\InvalidStyleException');
$this->exceptionHelper('\PHP_Parallel_Lint\PhpConsoleColor\InvalidStyleException');
$this->uut->apply('color_2134', 'text');
}

public function testThemeInvalidStyle()
{
$this->exceptionHelper('\JakubOnderka\PhpConsoleColor\InvalidStyleException');
$this->exceptionHelper('\PHP_Parallel_Lint\PhpConsoleColor\InvalidStyleException');
$this->uut->addTheme('invalid', array('invalid'));
}

Expand Down