Skip to content

Commit

Permalink
Merge branch '5.x'
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Apr 1, 2020
2 parents 436dd88 + d2ba062 commit fdaa71d
Show file tree
Hide file tree
Showing 29 changed files with 77 additions and 572 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: [7.4, 7.3, 7.2]
os: [ubuntu-latest, windows-latest]

name: PHP${{ matrix.php }} on ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlite3, pdo_sqlite, pdo_mysql, bcmath, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
1 change: 0 additions & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ return PhpCsFixer\Config::create()
'no_extra_consecutive_blank_lines' => false,
'no_unneeded_control_parentheses' => false,
'not_operator_with_successor_space' => true,
'no_superfluous_phpdoc_tags' => false,
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'phpdoc_align' => false,
'phpdoc_no_empty_return' => false,
Expand Down
140 changes: 0 additions & 140 deletions CHANGELOG-3.x.md

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG-4.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Released: 2019-09-11

### Changes

* Update support to Laravel Framework 6.0.
* Update support to Laravel Framework v6.

### Removed

Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG-5.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Changelog for 5.x

This changelog references the relevant changes (bug and security fixes) done to `orchestra/model`.

## 5.0.0

Released: 2020-03-09

### Changes

* Update support to Laravel Framework v7.

### Removed

* Remove `Orchestra\Model\HS`, use `Laravie\Dhosa\HotSwap`.
* Remove `Orchestra\Model\Concerns\Swappable`, use `Laravie\Dhosa\Concerns\Swappable`.
* Remove deprecated `Orchestra\Model\Concerns\AdvancedSearch`, use `Orchestra\Model\Concerns\Searchable`.
* Remove deprecated `getSearchableRules()`, use `getSearchableTerms()`.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"require": {
"php": ">=7.3",
"laravie/dhosa": "dev-master",
"orchestra/contracts": "^6.0",
"orchestra/database": "^6.0",
"orchestra/support": "^6.0"
Expand Down
7 changes: 1 addition & 6 deletions src/Concerns/CheckRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Orchestra\Model\Concerns;

use Illuminate\Support\Collection;
use Orchestra\Model\Role;

trait CheckRoles
Expand All @@ -10,8 +11,6 @@ trait CheckRoles
* Determine if current user has the given role.
*
* @param \Illuminate\Contracts\Support\Arrayable|array|string $roles
*
* @return bool
*/
public function hasRoles($roles): bool
{
Expand All @@ -32,8 +31,6 @@ public function hasRoles($roles): bool
* Determine if current user has any of the given role.
*
* @param \Illuminate\Contracts\Support\Arrayable|array|string $roles
*
* @return bool
*/
public function hasAnyRoles($roles): bool
{
Expand Down Expand Up @@ -92,8 +89,6 @@ public function detachRoles($roles)

/**
* Get roles name as an array.
*
* @return \Illuminate\Support\Collection
*/
abstract public function getRoles(): Collection;
}
2 changes: 0 additions & 2 deletions src/Concerns/Faker.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ trait Faker
{
/**
* Initiate faker factory.
*
* @return \Illuminate\Database\Eloquent\FactoryBuilder
*/
public static function faker(): FactoryBuilder
{
Expand Down
15 changes: 0 additions & 15 deletions src/Concerns/Metable.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ trait Metable
* `meta` field accessor.
*
* @param mixed $value
*
* @return \Orchestra\Model\Value\Meta
*/
public function getMetaAttribute($value): Meta
{
Expand All @@ -23,8 +21,6 @@ public function getMetaAttribute($value): Meta
* `meta` field mutator.
*
* @param mixed $value
*
* @return void
*/
public function setMetaAttribute($value = null): void
{
Expand All @@ -34,7 +30,6 @@ public function setMetaAttribute($value = null): void
/**
* Get original meta data.
*
* @param string $key
* @param mixed $default
*
* @return mixed
Expand All @@ -49,7 +44,6 @@ public function getOriginalMetaData(string $key, $default = null)
/**
* Get meta data.
*
* @param string $key
* @param mixed $default
*
* @return mixed
Expand All @@ -66,8 +60,6 @@ public function getMetaData(string $key, $default = null)
*
* @param string|array $key
* @param mixed $value
*
* @return void
*/
public function putMetaData($key, $value = null): void
{
Expand All @@ -88,8 +80,6 @@ public function putMetaData($key, $value = null): void
* Forget meta data.
*
* @param string|array $key
*
* @return void
*/
public function forgetMetaData($key): void
{
Expand All @@ -110,8 +100,6 @@ public function forgetMetaData($key): void
* Access meta attribute.
*
* @param mixed $value
*
* @return \Orchestra\Model\Value\Meta
*/
protected function accessMetableAttribute($value): Meta
{
Expand All @@ -129,10 +117,7 @@ protected function accessMetableAttribute($value): Meta
/**
* Get value from mixed content.
*
* @param string $key
* @param mixed $value
*
* @return string|null
*/
protected function mutateMetableAttribute(string $key, $value): ?string
{
Expand Down
11 changes: 0 additions & 11 deletions src/Concerns/OwnedBy.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ trait OwnedBy
{
/**
* Scope query to get model which are owned by the specified model.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param \Illuminate\Database\Eloquent\Model $related
* @param string|null $key
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeOwnedBy(Builder $query, Model $related, ?string $key = null): Builder
{
Expand All @@ -27,11 +21,6 @@ public function scopeOwnedBy(Builder $query, Model $related, ?string $key = null

/**
* Check if related model actually owns the relationship.
*
* @param \Illuminate\Database\Eloquent\Model|null $related
* @param string|null $key
*
* @return bool
*/
public function ownedBy(Model $related = null, ?string $key = null): bool
{
Expand Down
11 changes: 0 additions & 11 deletions src/Concerns/Owns.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ trait Owns
{
/**
* Scope query to get model which related model actually owns the relationship.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param \Illuminate\Database\Eloquent\Model $related
* @param string|null $foreignKey
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeOwns(Builder $query, Model $related, ?string $foreignKey = null): Builder
{
Expand All @@ -29,11 +23,6 @@ public function scopeOwns(Builder $query, Model $related, ?string $foreignKey =

/**
* Check if related model actually owns the relationship.
*
* @param \Illuminate\Database\Eloquent\Model|null $related
* @param string|null $foreignKey
*
* @return bool
*/
public function owns(Model $related = null, ?string $foreignKey = null): bool
{
Expand Down
Loading

0 comments on commit fdaa71d

Please sign in to comment.