Skip to content

Commit

Permalink
Adds with and has request
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstandiford committed Dec 3, 2022
1 parent 0225ab5 commit 053e926
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/Interfaces/Has_Request.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Underpin\Interfaces;

use Underpin\Factories\Request;

interface Has_Request {

function get_request(): Request;

function set_request( Request $request ): static;

}
22 changes: 22 additions & 0 deletions lib/Traits/With_Request.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Underpin\Traits;


use Underpin\Factories\Request;

trait With_Request {

protected Request $request;

public function get_request(): Request{
return $this->request;
}

public function set_request( Request $request ): static{
$this->request = $request;

return $this;
}

}

0 comments on commit 053e926

Please sign in to comment.