Skip to content

Commit

Permalink
Initial changes
Browse files Browse the repository at this point in the history
  • Loading branch information
specialtactics committed Dec 30, 2024
1 parent 8b9d39b commit cc26d67
Show file tree
Hide file tree
Showing 64 changed files with 378 additions and 380 deletions.
2 changes: 2 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ daysUntilStale: 180
daysUntilClose: 28
exemptLabels:
- keep-open
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
php: [7.4, 8.0, 8.1]
os: [ubuntu-24.04]
php: [8.1, 8.2, 8.3, 8.4]

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

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Static analysis
jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand All @@ -13,7 +13,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.4
extensions: apcu, redis
coverage: none
tools: phpstan:1.4.6, cs2pr
Expand All @@ -26,15 +26,15 @@ jobs:

psalm:
name: Psalm
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.4
extensions: apcu, redis
coverage: none
tools: vimeo/psalm:4.22.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/style-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.4'

- name: Cache Dependencies
id: composer-cache-style
Expand All @@ -29,4 +29,4 @@ jobs:
run: composer install --prefer-dist --no-progress --no-suggest

- name: Check Coding Style
run: vendor/bin/phpcs src/
run: vendor/bin/phpcs src/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
composer.lock
build
vendor
.phpunit.result.cache
.phpunit.result.cache
./phpunit.xml
22 changes: 0 additions & 22 deletions CONDUCT.md

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Contributions are **welcome** and will be fully **credited**.

We accept contributions via Pull Requests on [Github](https://github.com/thephpleague/fractal).
We accept contributions via Pull Requests on [Github](https://github.com/php-open-source-saver/fractal).


## Pull Requests
Expand Down
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2013 Phil Sturgeon <[email protected]>
Copyright (c) 2013-2024 Phil Sturgeon <[email protected]>
Copyright (c) 2024 PHP Open Source Saver

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
![The PHP League Tests](https://github.com/thephpleague/fractal/workflows/The%20PHP%20League%20Tests/badge.svg)
[![Total Downloads](https://img.shields.io/packagist/dt/league/fractal.svg?style=flat-square)](https://packagist.org/packages/league/fractal)

## Credits
[This repository is a fork from original thephpleague/fractal](https://fractal.thephpleague.com/), we decided to make an independent fork due to the lack of updates to the original package, and lack of a process for volunteers to become maintainers within the php league ecosystem of packages.

## Migrating from [`thephpleague/fractal`](https://github.com/thephpleague/fractal)

This uses different namespace to `thephpleague/fractal`, but overall, provides the same API, that makes migration to this repository pretty easy:

1) Run `composer remove thephpleague/fractal`
> **Info** An error will appear because the package is still in use, ignore it.
2) Replace all the occurrences of `League\Fractal` with `PHPOpenSourceSaver\Fractal`.
> **Tip**: You can use *Find and Replace* feature of your IDE. Try it with <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>R</kbd>
3) Run `composer require php-open-source-saver/fractal`

## Notes

Fractal provides a presentation and transformation layer for complex data output, the like found in
RESTful APIs, and works really well with JSON. Think of this as a view layer for your JSON/YAML/etc.

Expand Down Expand Up @@ -34,25 +49,21 @@ please send a patch via pull request.
Via Composer

``` bash
$ composer require league/fractal
$ composer require php-open-source-saver
```

## Requirements

The following versions of PHP are supported by this version:

&gt;= PHP 7.4
&gt;= PHP 8.1

## Documentation

Fractal has [full documentation](http://fractal.thephpleague.com), powered by [Jekyll](http://jekyllrb.com/).

Contribute to this documentation in the [gh-pages branch](https://github.com/thephpleague/fractal/tree/gh-pages/).

## Todo

- add HAL serializers

## Testing

``` bash
Expand Down
15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"name": "league/fractal",
"name": "php-open-source-saver/fractal",
"description": "Handle the output of complex data structures ready for API output.",
"keywords": [
"league",
"api",
"json",
"rest"
"rest",
"laravel"
],
"homepage": "http://fractal.thephpleague.com/",
"homepage": "https://github.com/PHP-Open-Source-Saver/fractal",
"support": {
"issues": "https://github.com/PHP-Open-Source-Saver/fractal/issues",
"source": "https://github.com/PHP-Open-Source-Saver/fractal"
},
"license": "MIT",
"authors": [
{
Expand All @@ -21,11 +26,11 @@
"sort-packages": true
},
"require": {
"php": ">=7.4"
"php": ">=8.1"
},
"require-dev": {
"doctrine/orm": "^2.5",
"illuminate/contracts": "~5.0",
"illuminate/contracts": "~10.0",
"mockery/mockery": "^1.3",
"pagerfanta/pagerfanta": "~1.0.0",
"phpstan/phpstan": "^1.4",
Expand Down
10 changes: 5 additions & 5 deletions src/Manager.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php

/*
* This file is part of the League\Fractal package.
* This file is part of the PHPOpenSourceSaver\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace League\Fractal;
namespace PHPOpenSourceSaver\Fractal;

use League\Fractal\Resource\ResourceInterface;
use League\Fractal\Serializer\DataArraySerializer;
use League\Fractal\Serializer\Serializer;
use PHPOpenSourceSaver\Fractal\Resource\ResourceInterface;
use PHPOpenSourceSaver\Fractal\Serializer\DataArraySerializer;
use PHPOpenSourceSaver\Fractal\Serializer\Serializer;

/**
* Manager
Expand Down
4 changes: 2 additions & 2 deletions src/Pagination/Cursor.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/*
* This file is part of the League\Fractal package.
* This file is part of the PHPOpenSourceSaver\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace League\Fractal\Pagination;
namespace PHPOpenSourceSaver\Fractal\Pagination;

/**
* A generic cursor adapter.
Expand Down
4 changes: 2 additions & 2 deletions src/Pagination/CursorInterface.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/*
* This file is part of the League\Fractal package.
* This file is part of the PHPOpenSourceSaver\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace League\Fractal\Pagination;
namespace PHPOpenSourceSaver\Fractal\Pagination;

/**
* A common interface for cursors to use.
Expand Down
4 changes: 2 additions & 2 deletions src/Pagination/DoctrinePaginatorAdapter.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
/*
* This file is part of the League\Fractal package.
* This file is part of the PHPOpenSourceSaver\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace League\Fractal\Pagination;
namespace PHPOpenSourceSaver\Fractal\Pagination;

use Doctrine\ORM\Tools\Pagination\Paginator;

Expand Down
4 changes: 2 additions & 2 deletions src/Pagination/IlluminatePaginatorAdapter.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/*
* This file is part of the League\Fractal package.
* This file is part of the PHPOpenSourceSaver\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace League\Fractal\Pagination;
namespace PHPOpenSourceSaver\Fractal\Pagination;

use Illuminate\Contracts\Pagination\LengthAwarePaginator;

Expand Down
4 changes: 2 additions & 2 deletions src/Pagination/PagerfantaPaginatorAdapter.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/*
* This file is part of the League\Fractal package.
* This file is part of the PHPOpenSourceSaver\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace League\Fractal\Pagination;
namespace PHPOpenSourceSaver\Fractal\Pagination;

use Pagerfanta\Pagerfanta;

Expand Down
4 changes: 2 additions & 2 deletions src/Pagination/PaginatorInterface.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/*
* This file is part of the League\Fractal package.
* This file is part of the PHPOpenSourceSaver\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace League\Fractal\Pagination;
namespace PHPOpenSourceSaver\Fractal\Pagination;

/**
* A common interface for paginators to use
Expand Down
4 changes: 2 additions & 2 deletions src/Pagination/PhalconFrameworkPaginatorAdapter.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/*
* This file is part of the League\Fractal package.
* This file is part of the PHPOpenSourceSaver\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace League\Fractal\Pagination;
namespace PHPOpenSourceSaver\Fractal\Pagination;

/**
* A paginator adapter for PhalconPHP/pagination.
Expand Down
4 changes: 2 additions & 2 deletions src/Pagination/ZendFrameworkPaginatorAdapter.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/*
* This file is part of the League\Fractal package.
* This file is part of the PHPOpenSourceSaver\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace League\Fractal\Pagination;
namespace PHPOpenSourceSaver\Fractal\Pagination;

use Zend\Paginator\Paginator;

Expand Down
4 changes: 2 additions & 2 deletions src/ParamBag.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/*
* This file is part of the League\Fractal package.
* This file is part of the PHPOpenSourceSaver\Fractal package.
*
* (c) Phil Sturgeon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace League\Fractal;
namespace PHPOpenSourceSaver\Fractal;

/**
* A handy interface for getting at include parameters.
Expand Down
Loading

0 comments on commit cc26d67

Please sign in to comment.