Skip to content

Commit 1d76167

Browse files
author
Kevin Buchholz
committed
Merge branch 'release/1.2.0'
2 parents ea52ac2 + 5d46344 commit 1d76167

12 files changed

+154
-5040
lines changed

.gitignore

+1-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
1-
Skip to content
2-
3-
Search or jump to…
4-
5-
Pull requests
6-
Issues
7-
Marketplace
8-
Explore
9-
@NeroAzure Sign out
10-
4
11-
5 0 sourceboat/laravel-static-permission
12-
Code Issues 0 Pull requests 0 Projects 0 Wiki Insights
13-
laravel-static-permission/.gitignore
14-
Philipp Kübler init commit
15-
091bbe7 on 28 Nov 2018
16-
608 lines (473 sloc) 10.7 KB
17-
18-
191
# Created by https://www.gitignore.io/api/osx,linux,windows,eclipse,composer,phpstorm,sublimetext,visualstudio,visualstudiocode
202
# Edit at https://www.gitignore.io/?templates=osx,linux,windows,eclipse,composer,phpstorm,sublimetext,visualstudio,visualstudiocode
213

224
### Composer ###
235
composer.phar
6+
composer.lock
247
/vendor/
258

269
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ php:
44
- 7.1
55
- 7.2
66
- 7.3
7+
- 7.4snapshot
78
- nightly
89

910
matrix:
@@ -13,6 +14,7 @@ matrix:
1314
- php: 7.2
1415
env: COMPOSER_FLAGS="--prefer-lowest"
1516
allow_failures:
17+
- php: 7.4snapshot
1618
- php: nightly
1719

1820
before_script:

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
## NEXT RELEASE
44

55

6+
## 1.2.0 - 2019-07-24 - minor release
7+
8+
### Changed
9+
- `__toString` has proper return type hint
10+
- Dependencies now properly allow laravel 5.7+
11+
12+
### Added
13+
- `is(EnumValue)` method to `Enumeration` (#2)
14+
- `is<EnumValue>()` methods to `Enumeration` via `__call` (#2)
15+
16+
617
## 1.1.0 - 2019-04-04 - minor release
718

819
### Fixed

README.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Strongly typed enum implementation for Laravel. Based on [eloquent/enumeration](
2020

2121
## Table of Contents
2222

23-
* [Guide](#guide)
23+
* [Requirements](#requirements)
2424
* [Install](#install)
2525
* [Generating enums](#generating-enums)
2626
* [Usage](#usage)
@@ -33,7 +33,7 @@ Strongly typed enum implementation for Laravel. Based on [eloquent/enumeration](
3333
## Requirements
3434

3535
* eloquent/enumeration 6.0 or newer
36-
* Laravel 5.4 or newer; Tested with 5.7
36+
* Laravel 5.7 or newer;
3737
* PHP 7.1 or newer
3838

3939
## Install
@@ -127,6 +127,25 @@ Returns the localized version of the value, default path is `enums.<EnumClass>.<
127127
UserType::SuperAdministrator()->localized(); // Returns for example 'Super Administrator', but `enums.App\Enums\UserType.3` when not set.
128128
```
129129

130+
### is(static): bool
131+
132+
Check if the instance is equal to the given member.
133+
134+
``` php
135+
UserType::SuperAdministrator()->is(UserType::Moderator()); // -> false
136+
UserType::SuperAdministrator()->is(UserType::SuperAdministrator()); // -> true
137+
```
138+
139+
### is<Enum_Value>(): bool
140+
141+
Check if the instance is equal to the member indicated by the method name.
142+
143+
``` php
144+
UserType::SuperAdministrator()->isModerator(); // -> false
145+
UserType::SuperAdministrator()->isSuperAdministrator(); // -> true
146+
UserType::SuperAdministrator()->isStudent(); // -> throws Eloquent\Enumeration\Exception\UndefinedMemberException
147+
```
148+
130149
### static randomMember(): static
131150

132151
Returns a random member from the enum. Useful for factories.

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"require": {
2727
"php": ">=7.1",
2828
"eloquent/enumeration": "^6.0",
29-
"laravel/framework": "5.7.*"
29+
"laravel/framework": ">=5.7"
3030
},
3131
"require-dev": {
3232
"consistence/coding-standard": "3.7",
@@ -50,7 +50,8 @@
5050
"test": "vendor/bin/phpunit",
5151
"test-coverage": "vendor/bin/phpunit --coverage-html coverage",
5252
"lint:phpcs": "vendor/bin/phpcs -s",
53-
"lint:phpmd": "vendor/bin/phpmd src,tests text phpmd.xml"
53+
"lint:phpmd": "vendor/bin/phpmd src,tests text phpmd.xml",
54+
"fix": "vendor/bin/phpcbf"
5455
},
5556
"extra": {
5657
"branch-alias": {

0 commit comments

Comments
 (0)