Skip to content

Commit

Permalink
Changed vendor to 'Safari'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Robert committed Mar 17, 2023
1 parent 89f8837 commit ff27b55
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 PAUL ROBERT
Copyright (c) 2023 PAUL ROBERT

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
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Safari
![github stars](https://img.shields.io/github/stars/phrenotype/safari?style=social)
![packagist stars](https://img.shields.io/packagist/stars/chase/safari)
![license](https://img.shields.io/github/license/phrenotype/safari)
![contributors](https://img.shields.io/github/contributors/phrenotype/safari)
![contributors](https://img.shields.io/github/languages/code-size/phrenotype/safari)
![downloads](https://img.shields.io/packagist/dm/chase/safari)
![code size](https://img.shields.io/github/languages/code-size/phrenotype/safari)


This library makes php forms easy to build and re-use, yes, re-use.

Expand All @@ -13,11 +12,11 @@ Just like orm models are simply declared and used over and over again, php form
Previously submitted form values are automatically filled or choosen.

## Install
`composer require chase/safari`
`composer require safari/safari`

## Usage

For each form, you need to define a class that extends `Chase\Safari\Form`, an abstract class. Ensure the parent constructor in called within your own constructor. The super global containing the form values should be passed to it. The super global is automatically encoded using `htmlentities` to prevent `xss`.
For each form, you need to define a class that extends `Safari\Form`, an abstract class. Ensure the parent constructor in called within your own constructor. The super global containing the form values should be passed to it. The super global is automatically encoded using `htmlentities` to prevent `xss`.

Additionally, you can optionally assign form attributes in the constructor. However, make sure you declare them as instance attributes or you will be unable to retrieve the values later.

Expand All @@ -26,7 +25,7 @@ Then, you are required to implement a method, `elements`, which returns an array
```php
<?php

use Chase\Safari\Form;
use Safari\Form;

class LoginForm extends Form
{
Expand Down Expand Up @@ -97,8 +96,8 @@ If you have any special values you intend to pass to your constructor, ensure yo
```php
<?php

use Chase\Safari\Form;
use Chase\Safari\Field;
use Safari\Form;
use Safari\Field;

class SampleForm extends Form
{
Expand Down
2 changes: 1 addition & 1 deletion Chase/Safari/Element.php → Safari/Element.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chase\Safari;
namespace Safari;

/**
* Just an element.
Expand Down
2 changes: 1 addition & 1 deletion Chase/Safari/Field.php → Safari/Field.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chase\Safari;
namespace Safari;


/**
Expand Down
2 changes: 1 addition & 1 deletion Chase/Safari/Form.php → Safari/Form.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chase\Safari;
namespace Safari;

/**
* Just an HTML form.
Expand Down
2 changes: 1 addition & 1 deletion Chase/Safari/Utils.php → Safari/Utils.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chase\Safari;
namespace Safari;

/**
* Exactly what it sounds like.
Expand Down
4 changes: 2 additions & 2 deletions Tests/FieldTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Chase\Safari\Element;
use Chase\Safari\Field;
use Safari\Element;
use Safari\Field;
use PHPUnit\Framework\TestCase;

class FieldTest extends TestCase
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chase/safari",
"description": "A form builder for bots and humans",
"name": "safari/safari",
"description": "A form builder for php.",
"type": "library",
"keywords": [
"form",
Expand All @@ -18,7 +18,7 @@
],
"autoload": {
"psr-4": {
"Chase\\": "Chase/"
"Safari\\": "Safari/"
},
"files": []
},
Expand Down

0 comments on commit ff27b55

Please sign in to comment.