Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Возможность не указывать необязательные поля #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rtmvnv
Copy link

@rtmvnv rtmvnv commented May 26, 2022

Добавлена возможность опускать следующие необязательные поля

  • group
  • nomenclatureCode
  • supplierInfo
  • supplierINN
  • agentType
  • agentInfo
  • unitOfMeasurement
  • additionalAttribute
  • manufacturerCountryCode
  • customsDeclarationNumber
  • excise

В коде уже частично была реализована эта возможность с помощью первой проверки в конструкции if
if ($manufacturerCountryCode && strlen($manufacturerCountryCode) > self::MAX_POSITION_MANUFACTURE_COUNTRY_CODE_LENGTH) array_push($errors, '...

Но совсем не указывать поля не позволяло присваивание $manufacturerCountryCode = $params['manufacturerCountryCode'];. При вызове возникало сообщение PHP Warning: Undefined array key "manufacturerCountryCode".

@rtmvnv rtmvnv changed the title Allow omitting optional fields Возможность не указывать необязательные поля May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant