Skip to content
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

refactor: move namespace to PinkaryProject #22

Merged
merged 3 commits into from
Apr 24, 2024
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
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<p align="center">
<img src="https://raw.githubusercontent.com/gloss-php/type-guard/master/docs/example.jpg" height="300" alt="Skeleton Php">
<img src="https://raw.githubusercontent.com/pinkary-project/type-guard/master/docs/example.jpg" height="300" alt="Logo of Pinkary Project">
<p align="center">
<a href="https://github.com/gloss-php/type-guard/actions"><img alt="GitHub Workflow Status (master)" src="https://github.com/gloss-php/type-guard/actions/workflows/tests.yml/badge.svg"></a>
<a href="https://packagist.org/packages/gloss-php/type-guard"><img alt="Total Downloads" src="https://img.shields.io/packagist/dt/gloss-php/type-guard"></a>
<a href="https://packagist.org/packages/gloss-php/type-guard"><img alt="Latest Version" src="https://img.shields.io/packagist/v/gloss-php/type-guard"></a>
<a href="https://packagist.org/packages/gloss-php/type-guard"><img alt="License" src="https://img.shields.io/packagist/l/gloss-php/type-guard"></a>
<a href="https://github.com/pinkary-project/type-guard/actions"><img alt="GitHub Workflow Status (master)" src="https://github.com/pinkary-project/type-guard/actions/workflows/tests.yml/badge.svg"></a>
<a href="https://packagist.org/packages/pinkary-project/type-guard"><img alt="Total Downloads" src="https://img.shields.io/packagist/dt/pinkary-project/type-guard"></a>
<a href="https://packagist.org/packages/pinkary-project/type-guard"><img alt="Latest Version" src="https://img.shields.io/packagist/v/pinkary-project/type-guard"></a>
<a href="https://packagist.org/packages/pinkary-project/type-guard"><img alt="License" src="https://img.shields.io/packagist/l/pinkary-project/type-guard"></a>
</p>
</p>

------

> This library is a **work in progress**. Please, do not use it in production.

Type Guard module is part of the [Gloss PHP](https://github.com/gloss-php), and allows you to **narrow down the type** of a variable to a more specific type. Using the `type` function, you can perform specific checks to determine the type of an object and then use that object in a way that is **type-safe** according to the [PHPStan](https://phpstan.org/) and [Psalm](https://psalm.dev/) static analyzers.
Type Guard module is part of the [Pinkary Project](https://github.com/pinkary-project), and allows you to **narrow down the type** of a variable to a more specific type. Using the `type` function, you can perform specific checks to determine the type of an object and then use that object in a way that is **type-safe** according to the [PHPStan](https://phpstan.org/) and [Psalm](https://psalm.dev/) static analyzers.

Here is an example, where we use the `type` function to narrow down the type of a variable that previously had a `mixed` type:

Expand Down Expand Up @@ -53,7 +53,7 @@ $users = type($users)->as(Collection::class);
You may use [Composer](https://getcomposer.org) to install Type Guard into your PHP project:

```bash
composer require gloss-php/type-guard
composer require pinkary-project/type-guard
```

## Usage
Expand Down Expand Up @@ -151,4 +151,4 @@ $variable = type($variable)->asIterable();

------

**Type Guard** is part of the [Gloss PHP](https://github.com/gloss-php) project. It was created by **[Nuno Maduro](https://twitter.com/enunomaduro)** and open-sourced under the **[MIT license](https://opensource.org/licenses/MIT)**.
**Type Guard** is part of the [Pinkary Project](https://github.com/pinkary-project) project. It was created by **[Nuno Maduro](https://twitter.com/enunomaduro)** and open-sourced under the **[MIT license](https://opensource.org/licenses/MIT)**.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gloss-php/type-guard",
"name": "pinkary-project/type-guard",
"description": "Type Guard module is part of the Gloss PHP, and allows you to narrow down the type of an variable to a more specific type.",
"keywords": ["gloss-php", "type-guard", "assert", "narrow", "type", "php"],
"keywords": ["pinkary-project", "type-guard", "assert", "narrow", "type", "php"],
"license": "MIT",
"authors": [
{
Expand All @@ -22,7 +22,7 @@
},
"autoload": {
"psr-4": {
"GlossPHP\\TypeGuard\\": "src/"
"PinkaryProject\\TypeGuard\\": "src/"
},
"files": [
"src/Functions.php"
Expand Down
Binary file removed docs/example.jpg
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

use GlossPHP\TypeGuard\Type;
use PinkaryProject\TypeGuard\Type;

if (! function_exists('type')) {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Not.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace GlossPHP\TypeGuard;
namespace PinkaryProject\TypeGuard;

use TypeError;

Expand Down
2 changes: 1 addition & 1 deletion src/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace GlossPHP\TypeGuard;
namespace PinkaryProject\TypeGuard;

use TypeError;

Expand Down