Skip to content

Commit 19ec611

Browse files
committed
Move to ThoroughPHP namespace
1 parent 18527a3 commit 19ec611

17 files changed

+40
-40
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: php
22
sudo: false
33
php:
4-
- 7.1
54
- 7.2
5+
- 7.3
66

77
before_install:
88
- composer self-update

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018 Vsevolod Vietluzhskykh
1+
Copyright (c) 2018-2019 Vsevolod Vietluzhskykh
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TypeGuard - PHP type validation partly inspired by [Ceylon Union and Intersection types](https://ceylon-lang.org/documentation/1.3/tour/types/)
22

3-
[![Build Status](https://travis-ci.com/Sevavietl/TypeGuard.svg?branch=master)](https://travis-ci.com/Sevavietl/TypeGuard)
4-
[![Coverage Status](https://coveralls.io/repos/github/Sevavietl/TypeGuard/badge.svg)](https://coveralls.io/github/Sevavietl/TypeGuard)
3+
[![Build Status](https://travis-ci.com/ThoroughPHP/TypeGuard.svg?branch=master)](https://travis-ci.com/ThoroughPHP/TypeGuard)
4+
[![Coverage Status](https://coveralls.io/repos/github/ThoroughPHP/TypeGuard/badge.svg)](https://coveralls.io/github/ThoroughPHP/TypeGuard)
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan)
77

@@ -12,32 +12,32 @@ TypeGuard can validate:
1212
- Scalar types: `string`, `integer`, etc.:
1313

1414
```php
15-
(new \TypeGuard\Guard('string'))->match('foo'); // => true
15+
(new TypeGuard('string'))->match('foo'); // => true
1616
```
1717

1818
- Object types: `ArrayAccess`, `stdClass`, etc.:
1919

2020
```php
21-
(new \TypeGuard\Guard('stdClass'))->match(new stdClass()); // => true
21+
(new TypeGuard('stdClass'))->match(new stdClass()); // => true
2222
```
2323

2424
- Union types: `string|integer`:
2525

2626
```php
27-
$guard = new \TypeGuard\Guard('string|integer');
27+
$guard = new TypeGuard('string|integer');
2828
$guard->match('foo'); // => true
2929
$guard->match(1); // => true
3030
```
3131

3232
- Intersection types: `ArrayAccess&Countable`:
3333

3434
```php
35-
(new \TypeGuard\Guard('ArrayAccess&Countable'))->match(new ArrayIterator()); // => true
35+
(new TypeGuard('ArrayAccess&Countable'))->match(new ArrayIterator()); // => true
3636
```
3737

3838
- Optional types: `?string`:
3939

4040
```php
41-
(new \TypeGuard\Guard('?string'))->match(null); // => true
41+
(new TypeGuard('?string'))->match(null); // => true
4242
```
4343

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "sevavietl/type-guard",
2+
"name": "thorough-php/type-guard",
33
"description": "PHP type validator",
44
"type": "library",
55
"require": {
6-
"php": ">=7.1"
6+
"php": ">=7.2"
77
},
88
"require-dev": {
99
"phpunit/phpunit": "^7.3",
@@ -12,12 +12,12 @@
1212
},
1313
"autoload": {
1414
"psr-4": {
15-
"TypeGuard\\": "src/"
15+
"ThoroughPHP\\TypeGuard\\": "src/"
1616
}
1717
},
1818
"autoload-dev": {
1919
"psr-4": {
20-
"TypeGuard\\Test\\": "test/"
20+
"ThoroughPHP\\TypeGuard\\Test\\": "test/"
2121
}
2222
},
2323
"license": "MIT",

src/ArrayType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace TypeGuard;
3+
namespace ThoroughPHP\TypeGuard;
44

55
final class ArrayType implements TypeInterface
66
{

src/IntersectionType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace TypeGuard;
3+
namespace ThoroughPHP\TypeGuard;
44

55
final class IntersectionType implements TypeInterface
66
{

src/OptionalType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace TypeGuard;
3+
namespace ThoroughPHP\TypeGuard;
44

55
final class OptionalType implements TypeInterface
66
{

src/Type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace TypeGuard;
3+
namespace ThoroughPHP\TypeGuard;
44

55
final class Type implements TypeInterface
66
{

src/Guard.php renamed to src/TypeGuard.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace TypeGuard;
3+
namespace ThoroughPHP\TypeGuard;
44

5-
final class Guard
5+
final class TypeGuard
66
{
77
/** @var TypeInterface */
88
private $type;

src/TypeInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace TypeGuard;
3+
namespace ThoroughPHP\TypeGuard;
44

55
interface TypeInterface
66
{

0 commit comments

Comments
 (0)