Easily decorate your method calls with laravel-decorator package

Overview

🎄 Laravel Decorator

Decorator pattern in laravel apps

Build Status Quality Score StyleCI Software License Latest Stable Version Code Coverage Total Downloads

Made with ❤️ for smart clean coders

A try to port "decorator" feature from python language to laravel framework.

python-and-prey

🚚 Installation :

composer require imanghafoori/laravel-decorator

What is a "Decorator"

A decorator is callable which wraps around the original decorated callable, in order to form a new callable composed of the previous two.

Like a python snake swallowing a deer whole and wraps around it's body !

After that the snake becomes capable to eat and digest grasses 🌿 because it has a deer inside it.

Technically, A "Decorator" :

1 - Is a "callable"

2 - which takes an other "callable" (as it's only argument, like a snake swallows an other snake)

3 - and returns a new "callable" (which internally calls the original callable, putting some code before and after it.)

What ?!??! ???! (0_o)

What can be considered as a "callable" within laravel ?!

Long story short, anything that can be called (invoked) with App::call(); or call_user_func() like: 'MyClass@myMethod' or a closure, [UserRepo::class, 'find']

Cache Like a Pro:

Caching DB queries is always a need,

but it is always annoying to add more code to the existing code. It will become more messy, we may break the current code, after all it adds a layer of fog. Yeah ?

Imagine that you have a UserControllerwhich calls a UserRepo@find to get a $user .

Then after a while you decide to put a cache layer between those two classes for obvious reasons.

According to SOLID principles, you shouldn't put the caching code logic neither in your controller nor your UserRepo. But somewhere in between.

In other words, you want to add a new feature (caching in this case) without modifing the existing code.

It smells like Open-closed Principle Yeah ?! 👃

You want to keep the responsibilities seperate. In this case caching should not be in a repository or controller but in it's own class.

It smells like Single Responsibility Principle yeah ?! 👃

class UserRepository
{
    function find($uid) {
        return User::find($uid);
    }
}

class MadUsersController extends Controller
{
    function show ($madUserId) {
        $madUser = app()->call('UserRepository@find', ['id' => $madUserId]);
    }
}

ok now there is no cache, going on. it is a direct call.

With the help of laravel-decorator built-in cache decorator, you can go to AppServiceProvider.php or any other service provider

<?php

use Imanghafoori\Decorator\Decorators\DecoratorFactory;

class AppServiceProvider extends ServiceProvider {

    public function boot( ) {

        $keyMaker = function ($madId) {
            return 'mad_user_key_' . $madId;
        };
        $time = 10;
        $decorator = DecoratorFactory::cache($keyMaker, $time);
        
        \Decorator::decorate('UserRepository@find', $decorator);
    }
}

You will get cached results from your calls, in your UserController without touching it ! but rememnber to change :

 app()->call('UserRepository@find', ...
 // to :
  app('decorator')->call('UserRepository@find', ...

Define Your Own Decorators:

public function boot () {
    \Decorator::define('myDecoratorName1', 'SomeClass@someMethod');
    
// or

    \Decorator::define('myDecoratorName2', function ($callable) {
        return function (...) use ($callable){ ... } 
    });
}

Then you can use this name (myDecoratorName) to decorate methods.

How to decorate a method ?

// You may set multiple decorators on a single method... 
\Decorator::decorate('class@method, 'someClass@someOtherDecorator'); // (first)

// or reference the decorator by it's name :
\Decorator::decorate('class@method, 'myDecoratorName'); // (second)

How to call a method with it's decorators ?

image

Decorate Facades :

Decorating Facade Methods

First, you should extend the Imanghafoori\Decorator\DecoratableFacade class (instead of the laravel base Facade).

image

Now You Can Apply Decorators in your ServiceProvider's boot method:

image

then if you call your facade as normal you get decorated results.

image

⚠️ Warning :

With great power, comes great responsibilities.

Remember not to violate the Liskoves Substitution Principle when you decorate something.

For example a method call which returns int|null should not unexpectedly return a string after being decorated.

$result = app('decorate')->call(...

Since the users of the method should be ready for type of value they get back.

But if you return only int and your decorator causes the null value to be filtered out. that's ok.

Your Stars Make Us Do More

As always if you found this package useful and you want to encourage us to maintain and work on it, Please press the star button to declare your willing.

More packages from the author:

💎 A minimal yet powerful package to give you opportunity to refactor your controllers.


💎 A minimal yet powerful package to give a better structure and caching opportunity for your laravel apps.


💎 It allows you login with any password in local environment only.


💎 Authorization and ACL is now very easy with hey-man package !!!


🍌 Reward me a banana 🍌

so that I will have energy to start the next package for you.

  • Dodge Coin: DJEZr6GJ4Vx37LGF3zSng711AFZzmJTouN

  • LiteCoin: ltc1q82gnjkend684c5hvprg95fnja0ktjdfrhcu4c4

  • BitCoin: bc1q53dys3jkv0h4vhl88yqhqzyujvk35x8wad7uf9

  • Ripple: rJwrb2v1TR6rAHRWwcYvNZxjDN2bYpYXhZ

  • Etherium: 0xa4898246820bbC8f677A97C2B73e6DBB9510151e


Comments
  • Release PHP 8.1 version

    Release PHP 8.1 version

    Hello there,

    First of all congratulations for your awesome package 🎉

    I am wondering to use it in one of my PHP 8.1 projects but I see that there aren't any releases supporting PHP 8.1 / Laravel 9 yet. Are you considering on releasing a PHP 8.1 major version? Is there something breaking because of this upgrade?

    Thank you!!

    opened by garciasdos 3
  • Bump symfony/http-foundation from 4.4.2 to 4.4.7

    Bump symfony/http-foundation from 4.4.2 to 4.4.7

    Bumps symfony/http-foundation from 4.4.2 to 4.4.7.

    Release notes

    Sourced from symfony/http-foundation's releases.

    v4.4.7

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.6...v4.4.7)

    • no changes

    v4.4.6

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.5...v4.4.6)

    • bug #36173 Fix clear cookie samesite (guillbdx)
    • bug #36103 fix preloading script generation (nicolas-grekas)

    v4.4.5

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.4...v4.4.5)

    • bug #35709 fix not sending Content-Type header for 204 responses (Tobion)
    • bug #35583 Add missing use statements (fabpot)

    v4.4.4

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.3...v4.4.4)

    • bug #35305  Fix stale-if-error behavior, add tests (mpdude)
    Commits
    • 62f9250 [HttpFoundation] Do not set the default Content-Type based on the Accept header
    • 67d0196 add missing gitattributes for phpunit-bridge
    • 0a3b771 Merge branch '3.4' into 4.4
    • a8833c5 [Http Foundation] Fix clear cookie samesite
    • 109ac25 [DI] fix preloading script generation
    • ff006c7 Fix more quotes in exception messages
    • f4dc52b Fix quotes in exception messages
    • 2d4d118 Merge branch '3.4' into 4.4
    • 13f9b08 Fix quotes in exception messages
    • 01887e8 Add missing dots at the end of exception messages
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 2
  • Bump guzzlehttp/psr7 from 2.0.0 to 2.2.1

    Bump guzzlehttp/psr7 from 2.0.0 to 2.2.1

    Bumps guzzlehttp/psr7 from 2.0.0 to 2.2.1.

    Release notes

    Sourced from guzzlehttp/psr7's releases.

    2.2.1

    See change log for changes.

    2.2.0

    See change log for changes.

    2.1.2

    See change log for changes.

    2.1.1

    See change log for changes.

    2.1.0

    See change log for changes.

    Changelog

    Sourced from guzzlehttp/psr7's changelog.

    2.2.1 - 2022-03-20

    Fixed

    • Correct header value validation

    2.2.0 - 2022-03-20

    Added

    • A more compressive list of mime types
    • Add JsonSerializable to Uri
    • Missing return types

    Fixed

    • Bug MultipartStream no uri metadata
    • Bug MultipartStream with filename for data:// streams
    • Fixed new line handling in MultipartStream
    • Reduced RAM usage when copying streams
    • Updated parsing in Header::normalize()

    2.1.1 - 2022-03-20

    Fixed

    • Validate header values properly

    2.1.0 - 2021-10-06

    Changed

    • Attempting to create a Uri object from a malformed URI will no longer throw a generic InvalidArgumentException, but rather a MalformedUriException, which inherits from the former for backwards compatibility. Callers relying on the exception being thrown to detect invalid URIs should catch the new exception.

    Fixed

    • Return null in caching stream size if remote size is null
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump laravel/framework from 8.50.0 to 8.75.0

    Bump laravel/framework from 8.50.0 to 8.75.0

    Bumps laravel/framework from 8.50.0 to 8.75.0.

    Release notes

    Sourced from laravel/framework's releases.

    v8.75.0

    Added

    • Added Illuminate/Support/Testing/Fakes/NotificationFake::assertSentTimes() (667cca8)
    • Added Conditionable trait to ComponentAttributeBag (#39861)
    • Added scheduler integration tests (#39862)
    • Added on-demand gate authorization (#39789)
    • Added countable interface to eloquent factory sequence (#39907, 1638472a, #39915)
    • Added Fulltext index for PostgreSQL (#39875)
    • Added method filterNulls() to Arr (#39921)

    Fixed

    • Fixes AsEncrypted traits not respecting nullable columns (#39848, 4c32bf8)
    • Fixed http client factory class exists bugfix (#39851)
    • Fixed calls to Connection::rollBack() with incorrect case (#39874)
    • Fixed bug where columns would be guarded while filling Eloquent models during unit tests (#39880)
    • Fixed for dropping columns when using MSSQL as database (#39905)

    Changed

    • Add proper paging offset when possible to sql server (#39863)
    • Correct pagination message in src/Illuminate/Pagination/resources/views/tailwind.blade.php (#39894)

    v8.74.0

    Added

    • Added optional except parameter to the PruneCommand (#39749, be4afcc)
    • Added Illuminate/Foundation/Application::hasDebugModeEnabled() (#39755)
    • Added Illuminate/Support/Facades/Event::fakeExcept() and Illuminate/Support/Facades/Event::fakeExceptFor() (#39752)
    • Added aggregate method to Eloquent passthru (#39772)
    • Added undot() method to Arr helpers and Collections (#39729)
    • Added reverse method to Str (#39816)
    • Added possibility to customize type column in database notifications using databaseType method (#39811)
    • Added Fulltext Index (#39821)

    Fixed

    • Fixed bus service provider when loaded outside of the framework (#39740)
    • Fixes logging deprecations when null driver do not exist (#39809)

    Changed

    • Validate connection name before resolve queue connection (#39751)
    • Bump Symfony to 5.4 (#39827)
    • Optimize the execution time of the unique method (#39822)

    v8.73.2

    Added

    • Added Illuminate/Foundation/Testing/Concerns/InteractsWithContainer::forgetMock() (#39713)
    • Added custom pagination information in resource (#39600)

    v8.73.1

    Revert

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump symfony/http-kernel from 5.3.3 to 5.4.4

    Bump symfony/http-kernel from 5.3.3 to 5.4.4

    Bumps symfony/http-kernel from 5.3.3 to 5.4.4.

    Release notes

    Sourced from symfony/http-kernel's releases.

    v5.4.4

    Changelog (https://github.com/symfony/http-kernel/compare/v5.4.3...v5.4.4)

    • no significant changes

    v5.4.3

    Changelog (https://github.com/symfony/http-kernel/compare/v5.4.2...v5.4.3)

    • bug #44634 Fix compatibility with php bridge and already started php sessions (alexander-schranz)

    v5.4.2

    Changelog (https://github.com/symfony/http-kernel/compare/v5.4.1...v5.4.2)

    • bug #44838 Fix enum typed bindings (ogizanagi)
    • bug #44826 Do not attempt to register enum arguments in controller service locator (ogizanagi)
    • bug #44809 relax return type for memory data collector (94noni)
    • bug #44618 Fix SessionListener without session in request (shyim)
    • bug #44518 Take php session.cookie settings into account (simonchrz)
    • bug #44649 fix how configuring log-level and status-code by exception works (nicolas-grekas)

    v5.4.1

    Changelog (https://github.com/symfony/http-kernel/compare/v5.4.0...v5.4.1)

    • bug #44437 Fix wrong usage of SessionUtils::popSessionCookie (simonchrz)
    • bug #44395 fix sending Vary: Accept-Language when appropriate (nicolas-grekas)

    v5.4.0

    Changelog (https://github.com/symfony/http-kernel/compare/v5.4.0-RC1...v5.4.0)

    • no significant changes

    v5.4.0-RC1

    Changelog (https://github.com/symfony/http-kernel/compare/v5.4.0-BETA3...v5.4.0-RC1)

    • no significant changes

    v5.4.0-BETA3

    Changelog (https://github.com/symfony/http-kernel/compare/v6.0.0-BETA2...v5.4.0-BETA3)

    • no significant changes

    v5.4.0-BETA2

    Changelog (https://github.com/symfony/http-kernel/compare/v5.4.0-BETA1...v5.4.0-BETA2)

    • feature #43983 allow ignoring kernel.reset methods that don't exist (nicolas-grekas)

    v5.4.0-BETA1

    Changelog (https://github.com/symfony/http-kernel/compare/v5.3.10...v5.4.0-BETA1)

    • feature #42471 Add generic types to traversable implementations (derrabus)

    ... (truncated)

    Changelog

    Sourced from symfony/http-kernel's changelog.

    CHANGELOG

    5.4

    • Add the ability to enable the profiler using a request query parameter, body parameter or attribute
    • Deprecate AbstractTestSessionListener::getSession inject a session in the request instead
    • Deprecate the fileLinkFormat parameter of DebugHandlersListener
    • Add support for configuring log level, and status code by exception class
    • Allow ignoring "kernel.reset" methods that don't exist with "on_invalid" attribute

    5.3

    • Deprecate ArgumentInterface
    • Add ArgumentMetadata::getAttributes()
    • Deprecate ArgumentMetadata::getAttribute(), use getAttributes() instead
    • Mark the class Symfony\Component\HttpKernel\EventListener\DebugHandlersListener as internal
    • Deprecate returning a ContainerBuilder from KernelInterface::registerContainerConfiguration()
    • Deprecate HttpKernelInterface::MASTER_REQUEST and add HttpKernelInterface::MAIN_REQUEST as replacement
    • Deprecate KernelEvent::isMasterRequest() and add isMainRequest() as replacement
    • Add #[AsController] attribute for declaring standalone controllers on PHP 8
    • Add FragmentUriGeneratorInterface and FragmentUriGenerator to generate the URI of a fragment

    5.2.0

    • added session usage
    • made the public http_cache service handle requests when available
    • allowed enabling trusted hosts and proxies using new kernel.trusted_hosts, kernel.trusted_proxies and kernel.trusted_headers parameters
    • content of request parameter _password is now also hidden in the request profiler raw content section
    • Allowed adding attributes on controller arguments that will be passed to argument resolvers.
    • kernels implementing the ExtensionInterface will now be auto-registered to the container
    • added parameter kernel.runtime_environment, defined as %env(default:kernel.environment:APP_RUNTIME_ENV)%
    • do not set a default Accept HTTP header when using HttpKernelBrowser

    5.1.0

    • allowed to use a specific logger channel for deprecations
    • made WarmableInterface::warmUp() return a list of classes or files to preload on PHP 7.4+; not returning an array is deprecated
    • made kernels implementing WarmableInterface be part of the cache warmup stage
    • deprecated support for service:action syntax to reference controllers, use serviceOrFqcn::method instead
    • allowed using public aliases to reference controllers
    • added session usage reporting when the _stateless attribute of the request is set to true
    • added AbstractSessionListener::onSessionUsage() to report when the session is used while a request is stateless

    ... (truncated)

    Commits
    • 49f4034 Update VERSION for 5.4.4
    • 86efc19 Bump Symfony version to 5.4.4
    • 936ca1b Update VERSION for 5.4.3
    • 6d593f6 [HttpKernel] fix tests
    • baae3ba [HttpKernel] Fix session test cases for symfony
    • eaa0b1a [HttpKernel] Fix compatibility with php bridge and already started php sessions
    • 2e1c19e Merge branch '5.3' into 5.4
    • 365376b Merge branch '4.4' into 5.3
    • c07a12a Bump license year
    • faf5917 Bump Symfony version to 5.4.3
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump symfony/http-foundation from 4.4.2 to 4.4.30

    Bump symfony/http-foundation from 4.4.2 to 4.4.30

    Bumps symfony/http-foundation from 4.4.2 to 4.4.30.

    Release notes

    Sourced from symfony/http-foundation's releases.

    v4.4.30

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.29...v4.4.30)

    • bug #42753 Cast ini_get to an integer to match expected type (natewiebe13)
    • bug #42260 Fix return types for PHP 8.1 (derrabus)

    v4.4.29

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.28...v4.4.29)

    • bug #42289 Fixed type mismatch (Toflar)

    v4.4.27

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.26...v4.4.27)

    • bug #42112 fix FileBag under PHP 8.1 (alexpott)
    • bug #42114 Fix return types of SessionHandler::gc() (derrabus)
    • bug #41384 Fix SkippedTestSuite (jderusse)

    v4.4.26

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.25...v4.4.26)

    • bug #41670 allow savePath of NativeFileSessionHandler to be null (simon.chrzanowski)
    • bug #41495 Add ReturnTypeWillChange to SessionHandlers (nikic)

    v4.4.25

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.24...v4.4.25)

    • no significant changes

    v4.4.23

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.22...v4.4.23)

    • no significant changes

    v4.4.22

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.21...v4.4.22)

    • bug #40964 Fixes for PHP 8.1 deprecations (jrmajor)
    • bug #40807 RequestMatcher issue when _controller is a closure (Plopix)
    • bug #40610 Fixed bugs found by psalm (Nyholm)

    v4.4.20

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.19...v4.4.20)

    • bug #40231 Configure session.cookie_secure earlier (tamcy)
    • bug #40188 Fix PHP 8.1 null values (kylekatarnls)
    • bug #40043 Setting REQUEST_TIME_FLOAT when constructing a Request object (ctasada)

    v4.4.19

    Changelog (https://github.com/symfony/http-foundation/compare/v4.4.18...v4.4.19)

    ... (truncated)

    Commits
    • 09b3202 Cast ini_get to an integer to match expected type
    • 69f0b8c bug #40545 [HttpFoundation] Fix isNotModified determination logic (ol0lll)
    • f9ce68e [HttpFoundation] Fix isNotModified determination logic
    • 2773deb Update NativeSessionStorage docblock to match defaults
    • b173540 Fix broken mock
    • 5556a4a Fix return types for PHP 8.1
    • 7016057 [HttpFoundation] Fixed type mismatch
    • 31d4a64 [4.4] Add missing @return annotations
    • 74abdd6 #42229 update phpdoc to recommend createIndex over ensureIndex
    • e18c77c fix intersection types in tests
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • [BUG] Error in Call method

    [BUG] Error in Call method

    • Laravel Version: 8.50
    • PHP Version: 7.4.8

    Description:

    This release introduced a bug.

    I got the following error message on Decorator::call method

    Illuminate\Contracts\Container\BindingResolutionException : Unable to resolve dependency [Parameter #0 [ $callable ]] in class Imanghafoori\Decorator\Decorators\DecoratorFactory

    Steps To Reproduce:

    1. \Decorator::decorate('UserRepository@find', $decorator);
    2. app('decorator')->call('UserRepository@find', ...
    3. Run a test.
    opened by mohammadv184 1
  • عدم سازگاری با نسخه 8 پی اچ پی

    عدم سازگاری با نسخه 8 پی اچ پی

    سلام با نسخه 8 پی اچ پی سلزگاری نداره .

    • imanghafoori/laravel-decorator requires php ^7.1.3|7.2.|7.3.|7.4.* which does not match your installed versio n 8.0.3.
    opened by ferasat 1
  • Bump symfony/http-foundation from 4.2.2 to 4.4.2

    Bump symfony/http-foundation from 4.2.2 to 4.4.2

    Bumps symfony/http-foundation from 4.2.2 to 4.4.2.

    Changelog

    Sourced from symfony/http-foundation's changelog.

    CHANGELOG

    5.1.0

    • Deprecate Response::create(), JsonResponse::create(), RedirectResponse::create(), and StreamedResponse::create() methods (use __construct() instead)
    • added Request::preferSafeContent() and Response::setContentSafe() to handle "safe" HTTP preference according to RFC 8674

    5.0.0

    • made Cookie auto-secure and lax by default
    • removed classes in the MimeType namespace, use the Symfony Mime component instead
    • removed method UploadedFile::getClientSize() and the related constructor argument
    • made Request::getSession() throw if the session has not been set before
    • removed Response::HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL
    • passing a null url when instantiating a RedirectResponse is not allowed

    4.4.0

    • passing arguments to Request::isMethodSafe() is deprecated.
    • ApacheRequest is deprecated, use the Request class instead.
    • passing a third argument to HeaderBag::get() is deprecated, use method all() instead
    • [BC BREAK] PdoSessionHandler with MySQL changed the type of the lifetime column, make sure to run ALTER TABLE sessions MODIFY sess_lifetime INTEGER UNSIGNED NOT NULL to update your database.
    • PdoSessionHandler now precalculates the expiry timestamp in the lifetime column, make sure to run CREATE INDEX EXPIRY ON sessions (sess_lifetime) to update your database to speed up garbage collection of expired sessions.
    • added SessionHandlerFactory to create session handlers with a DSN
    • added IpUtils::anonymize() to help with GDPR compliance.

    4.3.0

    • added PHPUnit constraints: RequestAttributeValueSame, ResponseCookieValueSame, ResponseHasCookie, ResponseHasHeader, ResponseHeaderSame, ResponseIsRedirected, ResponseIsSuccessful, and ResponseStatusCodeSame
    • deprecated MimeTypeGuesserInterface and ExtensionGuesserInterface in favor of Symfony\Component\Mime\MimeTypesInterface.
    • deprecated MimeType and MimeTypeExtensionGuesser in favor of Symfony\Component\Mime\MimeTypes.
    • deprecated FileBinaryMimeTypeGuesser in favor of Symfony\Component\Mime\FileBinaryMimeTypeGuesser.
    • deprecated FileinfoMimeTypeGuesser in favor of Symfony\Component\Mime\FileinfoMimeTypeGuesser.
    • added UrlHelper that allows to get an absolute URL and a relative path for a given path

    4.2.0

    ... (truncated)
    Commits
    • fcae1cf Merge branch '4.3' into 4.4
    • 9c06bf6 Merge branch '3.4' into 4.3
    • 5b932ee Fix typo
    • 760e8fb [HttpFoundation] fix pdo session handler for sqlsrv
    • a7ea28e Merge branch '4.3' into 4.4
    • 5a40ccd Merge branch '3.4' into 4.3
    • 7d2f82a use utf8mb4_bin to align code with documentation
    • 5a5c3b3 fix redis multi host dsn not recognized
    • da246f4 Removed request header "Content-Type" from the preferred format guessing mech...
    • 3439147 Merge branch '4.3' into 4.4
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(v1.0.6)
Owner
Iman
Coding is sport, it is art, it is science.
Iman
Repo do vídeo do youtube de Design Patterns - Decorator

DesignPatternsPHP-Decorator Repo do vídeo do Youtube de Design Patterns - Decorator Link do vídeo Decorator em PHP 8 Imagem de exemplo Link do cadastr

Leonardo Tumadjian 10 Aug 18, 2022
Making multiple identical function calls has the same effect as making a single function call.

Making multiple identical function calls has the same effect as making a single function call.

李铭昕 4 Oct 16, 2021
Making phone calls with PHP and Twilio Voice Service.

TwilioVoice-PHP This is an example implementation of Twilio's phone call API. You can clone this code to your project: git clone https://github.com/P

Philipe  Lima 2 Nov 15, 2022
Adds a header to every response to try and twart Google's usage of your site in it's FLoC tracking method.

Laravel No FLoC This package will add the Permissions-Policy: interest-cohort=() to try and twart Google's usage of your site in it's FLoC tracking me

Jean-Philippe Murray 11 Jul 14, 2022
With the help of the Laravel eCommerce CashU Payment Gateway, the admin can integrate the CashU payment method in the Bagisto store.

Introduction Bagisto CashU Payment add-on allow customers to pay for others using CashU payment gateway. Requirements: Bagisto: v1.3.2 Installation wi

Bagisto 2 Aug 22, 2022
Symfony bundle for class/method memoization

Symfony service memoization bundle This bundle provides memoization for your services - every time you call the same method with the same arguments a

Dominik Chrástecký 16 Oct 31, 2022
A Bayesian average is a method of estimating the mean of a population using outside information, especially a pre-existing belief, which is factored into the calculation

A Bayesian average is a method of estimating the mean of a population using outside information, especially a pre-existing belief, which is factored into the calculation.

Assisted Mindfulness 3 Oct 19, 2022
Laravel Blog Package. Easiest way to add a blog to your Laravel website. A package which adds wordpress functionality to your website and is compatible with laravel 8.

Laravel Blog Have you worked with Wordpress? Developers call this package wordpress-like laravel blog. Give our package a Star to support us ⭐ ?? Inst

Binshops 279 Dec 28, 2022
Testing your OpenApi documentation and your code easily.

Raven - How to test your API documentation and behavior. This library was written to allow testing OpenAPI documentation easily. It also allows verify

CH Studio 30 Dec 6, 2022
A Laravel Wrapper for the Binance API. Now easily connect and consume the Binance Public & Private API in your Laravel apps without any hassle.

This package provides a Laravel Wrapper for the Binance API and allows you to easily communicate with it. Important Note This package is in early deve

Moinuddin S. Khaja 7 Dec 7, 2022
salah eddine bendyab 18 Aug 17, 2021
A Symfony Feature Flag Bundle which easily allows you to configure and use your favorite feature flag provider.

Metro Markets FF Metro Markets FF is a Feature Flag Symfony Bundle. It easily allows you to configure and use your favorite feature flag provider. Ins

METRO Markets 14 May 23, 2022
Easily add logs anywhere in your Magento 2 code

Magento 2 Simple Log Easily add logs anywhere in the code (like Magento 1). Requirements Requires Magento 2 in any version. Installation Add the Log.p

Matthieu Vion 19 Dec 27, 2021
Thirdweb-wp - A community WordPress plugin for thirdweb. Turn your WordPress website into Web3 instantly and easily with thirdweb. 💻🌏

Thirdweb WP ?? Nominate (@WarenGonzaga) as GitHub Star. If you appreciate his hardwork and dedication to open source. A community WordPress plugin for

Waren Gonzaga 8 Dec 19, 2022
Quickly and easily preview and test your Magento 2 order confirmation page, without hacks or spending time placing new order each time

Preview Order Confirmation Page for Magento 2 For Magento 2.0.x, 2.1.x, 2.2.x and 2.3.x Styling and testing Magento's order confirmation page can be a

MagePal :: Magento Extensions 71 Aug 12, 2022
Easily create WooCommerce replacement orders for your customers.

Support Orders for WooCommerce Requires PHP: 7.0 WP requires at least: 5.7 WP tested up to: 5.7 WC requires at least: 5.6.0 WC tested up to: 5.8.0 Sta

DevPress 5 Feb 24, 2022
Easily manage git hooks in your composer config

composer-git-hooks Manage git hooks easily in your composer configuration. This command line tool makes it easy to implement a consistent project-wide

Ezinwa Okpoechi 985 Jan 3, 2023
Sentrifugo is a FREE and powerful Human Resource Management System (HRMS) that can be easily configured to meet your organizational needs.

Sentrifugo Sentrifugo is a free and powerful new-age Human Resource Management System that can be easily configured to adapt to your organizational pr

Sentrifugo 447 Dec 27, 2022