Skip to content

Commit

Permalink
add interface
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Aug 16, 2024
1 parent faf5e5e commit 122835d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ use Leuverink\InjectAssets\Contracts\AssetInjector;
class InjectAssets implements AssetInjector
{
// Used to determine if assets were already injected in the response
public string $identifier = 'MY_PACKAGE';
public function identifier() {
return 'MY_PACKAGE';
}

// Will inject return value in head tag or befor html close if no head is present
public function inject(): string
Expand Down
10 changes: 10 additions & 0 deletions src/Contracts/AssetInjector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Leuverink\InjectAssets\Contracts;

interface AssetInjector
{
public function identifier(): string;

public function inject(): string;
}

0 comments on commit 122835d

Please sign in to comment.