swisnl/textsnippet

Change the namespace in TextSnippet to Swis\TextSnippet

Opened this issue · 2 comments

I'll test your script in a Laravel environment. It looks promising. DuckDuckGo send me here. There is one little issue that will create a conflict in a(ny?) framework. In TextSnippetTest.php you'll have to change the namespace to Swis\TextSnippet\Test. In the namespace of the main class, change it to namespace Swis\TextSnippet; and we're good to go :)

How will this work in a Laravel framework? Advice the composer file in the autoload object. This is a simple workaround if there is no Service Provider / Facade, which is fine:

"files": [
            "packages/swis/textsnippet/src/TextSnippet.php"
        ]

This is enough to add the package to the composer autoload collection.

When needed (mostly in a controller, of course), simply use Swis\TextSnippet; and follow the explanation of the readme file in any method.

Hi @Dimimo, i'll fix the composer.json this week, or you could create a PR with the changes (that will be faster ;))

I have created a PR.