From c2f95094a0d376d8f99acf7ebc6b6c173455b14d Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Thu, 10 Jan 2019 20:30:16 -0500 Subject: [PATCH] Fix warning with PHP 7.3 --- CHANGELOG.md | 5 +++++ README.md | 9 +++------ src/RequestDataTransformer.php | 9 +++++++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2886c0f..ba7ab90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v4.1.3] - 2019-01-10 +### Fixed +- Fix warning with PHP 7.3 + ## [v4.1.2] - 2018-11-13 ### Fixed - Updated Run Method to add NameSpace Array ([#23](https://github.com/userfrosting/fortress/pull/23)) @@ -24,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Implement equals, not_equals, telephone, uri, and username rules +[v4.1.3]: https://github.com/userfrosting/fortress/compare/v4.1.2...v4.1.3 [v4.1.2]: https://github.com/userfrosting/fortress/compare/v4.1.1...v4.1.2 [v4.1.1]: https://github.com/userfrosting/fortress/compare/4.1.0...v4.1.1 [4.1.0]: https://github.com/userfrosting/fortress/compare/4.0.1...4.1.0 diff --git a/README.md b/README.md index f0fee3d..7693e9e 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,11 @@ # Fortress 4 +[![Latest Version](https://img.shields.io/github/release/userfrosting/fortress.svg)](https://github.com/userfrosting/fortress/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md) [![Build Status](https://travis-ci.org/userfrosting/fortress.svg?branch=master)](https://travis-ci.org/userfrosting/fortress) [![codecov](https://codecov.io/gh/userfrosting/fortress/branch/master/graph/badge.svg)](https://codecov.io/gh/userfrosting/fortress) [![Join the chat at https://chat.userfrosting.com/channel/support](https://demo.rocket.chat/images/join-chat.svg)](https://chat.userfrosting.com/channel/support) -[![Backers on Open Collective](https://opencollective.com/userfrosting/backers/badge.svg)](#backers) -[![Sponsors on Open Collective](https://opencollective.com/userfrosting/sponsors/badge.svg)](#sponsors) - - - - +[![Donate](https://img.shields.io/badge/Open%20Collective-Donate-blue.svg)](https://opencollective.com/userfrosting#backer) If you simply want to show that you like this project, or want to remember it for later, you should **star**, not **fork**, this repository. Forking is only for when you are ready to create your own copy of the code to work on. diff --git a/src/RequestDataTransformer.php b/src/RequestDataTransformer.php index 5059332..6f8c640 100644 --- a/src/RequestDataTransformer.php +++ b/src/RequestDataTransformer.php @@ -71,12 +71,17 @@ public function transform(array $data, $onUnexpectedVar = 'skip') // Handle values not listed in the schema if (!array_key_exists($name, $schemaFields)) { switch ($onUnexpectedVar) { - case 'allow': $transformedData[$name] = $value; break; + case 'allow': + $transformedData[$name] = $value; + break; case 'error': $e = new BadRequestException("The field '$name' is not a valid input field."); throw $e; break; - case 'skip': default: continue; + case 'skip': + default: + continue 2; + break; } } else { $transformedData[$name] = $this->transformField($name, $value);