• Stars
    star
    257
  • Rank 158,728 (Top 4 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Programmatically composable privacy policies for humans and machines

PHP-PrivacyPolicy

Programmatically composable privacy policies for humans and machines

Requirements

  • PHP 5.6.0+
    • Internationalization extension (intl)

Installation

  1. Include the library via Composer [?]:

    $ composer require delight-im/privacy-policy
    
  2. Include the Composer autoloader:

    require __DIR__ . '/vendor/autoload.php';

Upgrading

Migrating from an earlier version of this project? See our upgrade guide for help.

Usage

Creating an instance

Privacy policies for humans in natural language

$policy = new \Delight\PrivacyPolicy\Language\EnglishPrivacyPolicy();

// or

$policy = new \Delight\PrivacyPolicy\Language\GermanFormalPrivacyPolicy();
// or
$policy = new \Delight\PrivacyPolicy\Language\GermanInformalPrivacyPolicy();

Privacy policies for machines in formal language

$policy = new \Delight\PrivacyPolicy\Language\JsonPrivacyPolicy();

Displaying or printing an instance

Privacy policies for humans in natural language

$policy->toHtml();
// or
$policy->toPlainText();
// or
$policy->toMarkdown();

Privacy policies for machines in formal language

$policy->toJson();

Defining metadata

$policy->setPublishedAt(1393372800);
$policy->setTakesEffectAt(1394582400);
$policy->setExpiresAt(1395792000);
$policy->setVersionName('v3.1.4');
$policy->setCanonicalUrl('https://www.example.com/privacy.html');
$policy->setContactEmail('[email protected]');
$policy->setContactUrl('https://www.example.com/contact.html');
// $policy->setContactImage('https://www.example.com/images/contact.png', 'Jane Doe, 123 Main Street, Anytown, USA', 420, 360);

Describing your privacy practices

$policy->setUserDataTraded(false);
$policy->setDataMinimizationGoal(true);
$policy->setChildrenMinimumAge(16);
$policy->setPromotionalEmailOptOut(true);
$policy->setFirstPartyCookies(true);
$policy->setThirdPartyCookies(true);
$policy->setAccountDeletable(true);
$policy->setPreservationInBackups(true);
$policy->setThirdPartyServiceProviders(true);
$policy->setInternationalTransfers(true);
$policy->setTransferUponMergerOrAcquisition(true);
$policy->setTlsEverywhere(true);
$policy->setCompetentSupervisoryAuthority('Estonian Data Protection Inspectorate', 'http://www.aki.ee/en');
$policy->setNotificationPeriod(30);
$policy->setRightOfAccess(true);
$policy->setRightToRectification(true);
$policy->setRightToErasure(true);
$policy->setRightToRestrictProcessing(true);
$policy->setRightToDataPortability(true);
$policy->setRightToObject(true);
$policy->setRightsRelatedToAutomatedDecisions(true);

Explaining the amount, type and purpose of the data you collect

$policy->addDataGroup(
    'Server logs',
    'Whenever you access our services, ...',
    [ \Delight\PrivacyPolicy\Data\DataBasis::LEGITIMATE_INTERESTS ],
    null, // [ \Delight\PrivacyPolicy\Data\DataSpecialCondition::EXPLICIT_CONSENT ]
    [ \Delight\PrivacyPolicy\Data\DataPurpose::ADMINISTRATION ],
    \Delight\PrivacyPolicy\Data\DataRequirement::ALWAYS,

    function (\Delight\PrivacyPolicy\Data\DataGroup $group) {
        $group->addElement(
            \Delight\PrivacyPolicy\Data\DataType::ACCESS_IP_ADDRESS,
            \Delight\PrivacyPolicy\Data\DataRequirement::ALWAYS,
            24 * 7
        );
    }
);

Lawful bases

\Delight\PrivacyPolicy\Data\DataBasis::CONSENT;
\Delight\PrivacyPolicy\Data\DataBasis::CONTRACT;
\Delight\PrivacyPolicy\Data\DataBasis::LEGAL_OBLIGATION;
\Delight\PrivacyPolicy\Data\DataBasis::LEGITIMATE_INTERESTS;
\Delight\PrivacyPolicy\Data\DataBasis::PUBLIC_INTEREST;
\Delight\PrivacyPolicy\Data\DataBasis::VITAL_INTERESTS;

Special conditions

\Delight\PrivacyPolicy\Data\DataSpecialCondition::ARCHIVING_OR_RESEARCH;
\Delight\PrivacyPolicy\Data\DataSpecialCondition::EMPLOYMENT_AND_SOCIAL_SECURITY;
\Delight\PrivacyPolicy\Data\DataSpecialCondition::EXPLICIT_CONSENT;
\Delight\PrivacyPolicy\Data\DataSpecialCondition::FOUNDATION_ASSOCIATION_OR_NON_PROFIT;
\Delight\PrivacyPolicy\Data\DataSpecialCondition::HEALTH_AND_SOCIAL_CARE;
\Delight\PrivacyPolicy\Data\DataSpecialCondition::LEGAL_CLAIMS_OR_JUDICIAL_CAPACITY;
\Delight\PrivacyPolicy\Data\DataSpecialCondition::PUBLIC_DATA;
\Delight\PrivacyPolicy\Data\DataSpecialCondition::PUBLIC_HEALTH;
\Delight\PrivacyPolicy\Data\DataSpecialCondition::SUBSTANTIAL_PUBLIC_INTEREST;
\Delight\PrivacyPolicy\Data\DataSpecialCondition::VITAL_INTERESTS;

Data purposes

\Delight\PrivacyPolicy\Data\DataPurpose::ADMINISTRATION;
\Delight\PrivacyPolicy\Data\DataPurpose::ADVERTISING;
\Delight\PrivacyPolicy\Data\DataPurpose::CUSTOMER_SUPPORT;
\Delight\PrivacyPolicy\Data\DataPurpose::FULFILLMENT;
\Delight\PrivacyPolicy\Data\DataPurpose::MARKETING;
\Delight\PrivacyPolicy\Data\DataPurpose::PERSONALIZATION;
\Delight\PrivacyPolicy\Data\DataPurpose::RESEARCH;

Data requirements

\Delight\PrivacyPolicy\Data\DataRequirement::ALWAYS;
\Delight\PrivacyPolicy\Data\DataRequirement::OPT_IN;
\Delight\PrivacyPolicy\Data\DataRequirement::OPT_OUT;

Data types

Primary
\Delight\PrivacyPolicy\Data\DataType::ACCESS_DATETIME;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_DATETIME_DATE;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_DATETIME_TIME;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_HTTP_METHOD;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_HTTP_STATUS;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_IP_ADDRESS;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_IP_ADDRESS_25_PERCENT;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_IP_ADDRESS_50_PERCENT;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_IP_ADDRESS_75_PERCENT;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_REFERER;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_SIZE;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_URL;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_USERAGENT_STRING;

\Delight\PrivacyPolicy\Data\DataType::BILLING_CANCELLATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::BILLING_END_TIME;
\Delight\PrivacyPolicy\Data\DataType::BILLING_FREE_TRIAL;
\Delight\PrivacyPolicy\Data\DataType::BILLING_MODIFICATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::BILLING_NEXT_PAYMENT_TIME;
\Delight\PrivacyPolicy\Data\DataType::BILLING_PAST_DUE;
\Delight\PrivacyPolicy\Data\DataType::BILLING_PLAN;
\Delight\PrivacyPolicy\Data\DataType::BILLING_START_TIME;

\Delight\PrivacyPolicy\Data\DataType::CUSTOMER_NUMBER;

\Delight\PrivacyPolicy\Data\DataType::DEVICE_BROWSER;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_BROWSER_BRAND;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_BROWSER_VERSION;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_DATETIME_TIME_ZONE;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_ID;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_ID_IMEI;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_ID_MAC_ADDRESS;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_ID_PERMANENT;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_ID_RESETTABLE;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_LANGUAGE;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_LOCATION_APPROXIMATE;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_LOCATION_PRECISE;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_MANUFACTURER;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_MODEL;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_OS;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_OS_BRAND;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_OS_VERSION;

\Delight\PrivacyPolicy\Data\DataType::USER_ACCESS_PRIVILEGES;
\Delight\PrivacyPolicy\Data\DataType::USER_ADDRESS;
\Delight\PrivacyPolicy\Data\DataType::USER_ADDRESS_COUNTRY;
\Delight\PrivacyPolicy\Data\DataType::USER_ADDRESS_LOCALITY;
\Delight\PrivacyPolicy\Data\DataType::USER_ADDRESS_PLACE;
\Delight\PrivacyPolicy\Data\DataType::USER_ADDRESS_POSTAL_CODE;
\Delight\PrivacyPolicy\Data\DataType::USER_ADDRESS_REGION;
\Delight\PrivacyPolicy\Data\DataType::USER_BIRTH_DATE;
\Delight\PrivacyPolicy\Data\DataType::USER_BIRTH_DATE_MONTH_DAY;
\Delight\PrivacyPolicy\Data\DataType::USER_BIRTH_DATE_YEAR;
\Delight\PrivacyPolicy\Data\DataType::USER_BIRTH_DATE_YEAR_MONTH;
\Delight\PrivacyPolicy\Data\DataType::USER_BIRTH_PLACE;
\Delight\PrivacyPolicy\Data\DataType::USER_BLOOD_GROUP;
\Delight\PrivacyPolicy\Data\DataType::USER_COMPANY_DEPARTMENT;
\Delight\PrivacyPolicy\Data\DataType::USER_COMPANY_LOGO;
\Delight\PrivacyPolicy\Data\DataType::USER_COMPANY_NAME;
\Delight\PrivacyPolicy\Data\DataType::USER_COUNTRY;
\Delight\PrivacyPolicy\Data\DataType::USER_EMAIL;
\Delight\PrivacyPolicy\Data\DataType::USER_EMAIL_VERIFIED;
\Delight\PrivacyPolicy\Data\DataType::USER_FAX;
\Delight\PrivacyPolicy\Data\DataType::USER_FINANCIAL_BANK_ACCOUNT_ID;
\Delight\PrivacyPolicy\Data\DataType::USER_FINANCIAL_BANK_ID;
\Delight\PrivacyPolicy\Data\DataType::USER_FINANCIAL_BANK_NAME;
\Delight\PrivacyPolicy\Data\DataType::USER_FINANCIAL_CREDIT_CARD_BRAND;
\Delight\PrivacyPolicy\Data\DataType::USER_FINANCIAL_CREDIT_CARD_CVC;
\Delight\PrivacyPolicy\Data\DataType::USER_FINANCIAL_CREDIT_CARD_EXPIRATION;
\Delight\PrivacyPolicy\Data\DataType::USER_FINANCIAL_CREDIT_CARD_NUMBER;
\Delight\PrivacyPolicy\Data\DataType::USER_GENDER;
\Delight\PrivacyPolicy\Data\DataType::USER_GEO_COORDINATES;
\Delight\PrivacyPolicy\Data\DataType::USER_HEIGHT;
\Delight\PrivacyPolicy\Data\DataType::USER_IDENTIFIERS_DEU_ST_IDNR;
\Delight\PrivacyPolicy\Data\DataType::USER_IDENTIFIERS_DEU_ST_NR;
\Delight\PrivacyPolicy\Data\DataType::USER_IDENTIFIERS_EU_VAT_IN;
\Delight\PrivacyPolicy\Data\DataType::USER_IDENTIFIERS_USA_SSN;
\Delight\PrivacyPolicy\Data\DataType::USER_IP_ADDRESS;
\Delight\PrivacyPolicy\Data\DataType::USER_IP_ADDRESS_25_PERCENT;
\Delight\PrivacyPolicy\Data\DataType::USER_IP_ADDRESS_50_PERCENT;
\Delight\PrivacyPolicy\Data\DataType::USER_IP_ADDRESS_75_PERCENT;
\Delight\PrivacyPolicy\Data\DataType::USER_LOGIN_DATETIME;
\Delight\PrivacyPolicy\Data\DataType::USER_LOGIN_DATETIME_DATE;
\Delight\PrivacyPolicy\Data\DataType::USER_LOGIN_DATETIME_TIME;
\Delight\PrivacyPolicy\Data\DataType::USER_NAME;
\Delight\PrivacyPolicy\Data\DataType::USER_NAME_ALIAS;
\Delight\PrivacyPolicy\Data\DataType::USER_NAME_FAMILY;
\Delight\PrivacyPolicy\Data\DataType::USER_NAME_GIVEN;
\Delight\PrivacyPolicy\Data\DataType::USER_NOTES;
\Delight\PrivacyPolicy\Data\DataType::USER_OCCUPATION;
\Delight\PrivacyPolicy\Data\DataType::USER_OCCUPATION_CURRENT;
\Delight\PrivacyPolicy\Data\DataType::USER_OCCUPATION_PREFERRED;
\Delight\PrivacyPolicy\Data\DataType::USER_PASSWORD_CLEARTEXT;
\Delight\PrivacyPolicy\Data\DataType::USER_PASSWORD_HASHED;
\Delight\PrivacyPolicy\Data\DataType::USER_PASSWORD_HASHED_STRONG;
\Delight\PrivacyPolicy\Data\DataType::USER_PASSWORD_RESETTABLE;
\Delight\PrivacyPolicy\Data\DataType::USER_PHONE;
\Delight\PrivacyPolicy\Data\DataType::USER_PHONE_HOME;
\Delight\PrivacyPolicy\Data\DataType::USER_PHONE_MOBILE;
\Delight\PrivacyPolicy\Data\DataType::USER_PICTURE;
\Delight\PrivacyPolicy\Data\DataType::USER_REGISTRATION_DATETIME;
\Delight\PrivacyPolicy\Data\DataType::USER_REGISTRATION_DATETIME_DATE;
\Delight\PrivacyPolicy\Data\DataType::USER_REGISTRATION_DATETIME_TIME;
\Delight\PrivacyPolicy\Data\DataType::USER_SIGNATURE;
\Delight\PrivacyPolicy\Data\DataType::USER_SIGNATURE_DRAWN;
\Delight\PrivacyPolicy\Data\DataType::USER_SIGNATURE_HANDWRITTEN;
\Delight\PrivacyPolicy\Data\DataType::USER_WEBSITE_URL;
\Delight\PrivacyPolicy\Data\DataType::USER_WEIGHT;
Secondary
\Delight\PrivacyPolicy\Data\DataType::ACCESS_APP_VERSION;
\Delight\PrivacyPolicy\Data\DataType::ACCESS_FIRST_TIME;

\Delight\PrivacyPolicy\Data\DataType::BILLING_ID_PAYMENT_SERVICE_PROVIDER;

\Delight\PrivacyPolicy\Data\DataType::CALENDAR_EVENT_DATETIME;
\Delight\PrivacyPolicy\Data\DataType::CALENDAR_EVENT_DATETIME_DATE;
\Delight\PrivacyPolicy\Data\DataType::CALENDAR_EVENT_DATETIME_TIME;
\Delight\PrivacyPolicy\Data\DataType::CALENDAR_EVENT_TITLE;
\Delight\PrivacyPolicy\Data\DataType::CALENDAR_EVENT_TYPE;

\Delight\PrivacyPolicy\Data\DataType::CLIENT_DIAGNOSTICS;
\Delight\PrivacyPolicy\Data\DataType::CLIENT_DIAGNOSTICS_ENERGY_USAGE;
\Delight\PrivacyPolicy\Data\DataType::CLIENT_DIAGNOSTICS_ERRORS;
\Delight\PrivacyPolicy\Data\DataType::CLIENT_DIAGNOSTICS_ERRORS_LOGS;
\Delight\PrivacyPolicy\Data\DataType::CLIENT_DIAGNOSTICS_ERRORS_RATE;
\Delight\PrivacyPolicy\Data\DataType::CLIENT_DIAGNOSTICS_FRAME_RATE;
\Delight\PrivacyPolicy\Data\DataType::CLIENT_DIAGNOSTICS_TIMING;

\Delight\PrivacyPolicy\Data\DataType::CLIENT_INTERACTIONS;
\Delight\PrivacyPolicy\Data\DataType::CLIENT_INTERACTIONS_CLICKS_OR_TAPS;
\Delight\PrivacyPolicy\Data\DataType::CLIENT_INTERACTIONS_SESSIONS;
\Delight\PrivacyPolicy\Data\DataType::CLIENT_INTERACTIONS_VIEWS;
\Delight\PrivacyPolicy\Data\DataType::CLIENT_INTERACTIONS_VISITS;

\Delight\PrivacyPolicy\Data\DataType::CONTACT_ADDRESS;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_ADDRESS_COUNTRY;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_ADDRESS_LOCALITY;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_ADDRESS_PLACE;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_ADDRESS_POSTAL_CODE;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_ADDRESS_REGION;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_BIRTH_DATE;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_BIRTH_DATE_MONTH_DAY;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_BIRTH_DATE_YEAR;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_BIRTH_DATE_YEAR_MONTH;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_COMPANY_DEPARTMENT;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_COMPANY_NAME;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_CREATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_EMAIL;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_FAX;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_FINANCIAL_BANK_ACCOUNT_ID;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_FINANCIAL_BANK_ID;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_FINANCIAL_BANK_NAME;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_GENDER;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_IDENTIFIERS_EU_VAT_IN;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_MODIFICATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_NAME;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_NAME_ALIAS;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_NAME_FAMILY;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_NAME_GIVEN;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_ORIGINAL_MESSAGE_TIME;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_PHONE;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_PHONE_HOME;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_PHONE_MOBILE;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_REFERENCE;
\Delight\PrivacyPolicy\Data\DataType::CONTACT_WEBSITE_URL;

\Delight\PrivacyPolicy\Data\DataType::EMAIL_BCC;
\Delight\PrivacyPolicy\Data\DataType::EMAIL_BODY;
\Delight\PrivacyPolicy\Data\DataType::EMAIL_CC;
\Delight\PrivacyPolicy\Data\DataType::EMAIL_DATETIME;
\Delight\PrivacyPolicy\Data\DataType::EMAIL_DATETIME_DATE;
\Delight\PrivacyPolicy\Data\DataType::EMAIL_DATETIME_TIME;
\Delight\PrivacyPolicy\Data\DataType::EMAIL_FROM;
\Delight\PrivacyPolicy\Data\DataType::EMAIL_REPLY_TO;
\Delight\PrivacyPolicy\Data\DataType::EMAIL_RETURN_PATH;
\Delight\PrivacyPolicy\Data\DataType::EMAIL_SUBJECT;
\Delight\PrivacyPolicy\Data\DataType::EMAIL_TO;

\Delight\PrivacyPolicy\Data\DataType::FILE_CONTENTS;
\Delight\PrivacyPolicy\Data\DataType::FILE_NAME;
\Delight\PrivacyPolicy\Data\DataType::FILE_SIZE;

\Delight\PrivacyPolicy\Data\DataType::INVOICE_AMOUNT_GROSS;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_AMOUNT_NET;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_CUSTOMER_NUMBER;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_DATETIME_DATE;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_FULFILLMENT_PERIOD;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_NUMBER;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_RECIPIENT;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_TAXES;

\Delight\PrivacyPolicy\Data\DataType::USER_REFERENCE;
Tertiary
\Delight\PrivacyPolicy\Data\DataType::ACCESS_DEVICE_FEATURES_FILE_UPLOAD;

\Delight\PrivacyPolicy\Data\DataType::CONTRACT_BILLING_AMOUNT;
\Delight\PrivacyPolicy\Data\DataType::CONTRACT_BILLING_CYCLE;
\Delight\PrivacyPolicy\Data\DataType::CONTRACT_CANCELLATION_PERIOD;
\Delight\PrivacyPolicy\Data\DataType::CONTRACT_CANCELLATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::CONTRACT_CREATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::CONTRACT_MODIFICATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::CONTRACT_NOTES;
\Delight\PrivacyPolicy\Data\DataType::CONTRACT_PARTNER;
\Delight\PrivacyPolicy\Data\DataType::CONTRACT_PERIOD_END;
\Delight\PrivacyPolicy\Data\DataType::CONTRACT_PERIOD_EXTENSION;
\Delight\PrivacyPolicy\Data\DataType::CONTRACT_PERIOD_START;

\Delight\PrivacyPolicy\Data\DataType::DEVICE_DIAGNOSTICS;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_DIAGNOSTICS_ENERGY;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_DIAGNOSTICS_ENERGY_LEVEL;
\Delight\PrivacyPolicy\Data\DataType::DEVICE_DIAGNOSTICS_ENERGY_SOURCE;

\Delight\PrivacyPolicy\Data\DataType::INVOICE_CREATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_DISCOUNT;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_ITEM_DESCRIPTION;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_ITEM_DISCOUNT;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_ITEM_PRICE_GROSS;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_ITEM_PRICE_NET;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_ITEM_QUANTITY;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_ITEM_TAXES;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_MESSAGE;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_MODIFICATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_NOTES;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_PAYMENT_DATETIME;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_PAYMENT_TERMS;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_REFUND_DATETIME;
\Delight\PrivacyPolicy\Data\DataType::INVOICE_REMINDER_DATETIME;

\Delight\PrivacyPolicy\Data\DataType::LETTER_BODY;
\Delight\PrivacyPolicy\Data\DataType::LETTER_CC;
\Delight\PrivacyPolicy\Data\DataType::LETTER_CREATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::LETTER_DATETIME;
\Delight\PrivacyPolicy\Data\DataType::LETTER_DATETIME_DATE;
\Delight\PrivacyPolicy\Data\DataType::LETTER_DATETIME_TIME;
\Delight\PrivacyPolicy\Data\DataType::LETTER_ENCLOSURES;
\Delight\PrivacyPolicy\Data\DataType::LETTER_HEADLINE;
\Delight\PrivacyPolicy\Data\DataType::LETTER_IS_FIRST;
\Delight\PrivacyPolicy\Data\DataType::LETTER_MATTER_PERSONAL_OR_BUSINESS;
\Delight\PrivacyPolicy\Data\DataType::LETTER_MODIFICATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::LETTER_PS;
\Delight\PrivacyPolicy\Data\DataType::LETTER_SALUTATION;
\Delight\PrivacyPolicy\Data\DataType::LETTER_SUBJECT;
\Delight\PrivacyPolicy\Data\DataType::LETTER_VALEDICTION;

\Delight\PrivacyPolicy\Data\DataType::USER_COMPANY_COMMERCIAL_REGISTER_ENTRY;
\Delight\PrivacyPolicy\Data\DataType::USER_COMPANY_EXECUTIVE_BOARD_MEMBERS;
\Delight\PrivacyPolicy\Data\DataType::USER_COMPANY_LOGO_CREATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::USER_COMPANY_LOGO_LABEL;
\Delight\PrivacyPolicy\Data\DataType::USER_COMPANY_LOGO_MODIFICATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::USER_COMPANY_MANAGEMENT_MEMBERS;
\Delight\PrivacyPolicy\Data\DataType::USER_COMPANY_SUPERVISORY_BOARD_MEMBERS;
\Delight\PrivacyPolicy\Data\DataType::USER_FINANCIAL_PURCHASE_HISTORY;
\Delight\PrivacyPolicy\Data\DataType::USER_IDENTIFIERS_ACCOUNT_ID;
\Delight\PrivacyPolicy\Data\DataType::USER_IDENTIFIERS_ACCOUNT_NAME;
\Delight\PrivacyPolicy\Data\DataType::USER_IDENTIFIERS_ACCOUNT_TYPE;
\Delight\PrivacyPolicy\Data\DataType::USER_SIGNATURE_CREATION_TIME;
\Delight\PrivacyPolicy\Data\DataType::USER_SIGNATURE_LABEL;
\Delight\PrivacyPolicy\Data\DataType::USER_SIGNATURE_MODIFICATION_TIME;

\Delight\PrivacyPolicy\Data\DataType::VEHICLE_COLOR;
\Delight\PrivacyPolicy\Data\DataType::VEHICLE_CONSTRUCTION_PLACE;
\Delight\PrivacyPolicy\Data\DataType::VEHICLE_CONSTRUCTION_YEAR;
\Delight\PrivacyPolicy\Data\DataType::VEHICLE_MAKE;
\Delight\PrivacyPolicy\Data\DataType::VEHICLE_MODEL;
\Delight\PrivacyPolicy\Data\DataType::VEHICLE_NOTES;
\Delight\PrivacyPolicy\Data\DataType::VEHICLE_REGISTRATION_PLATE_NUMBER;

Specifying the scope of your policy

$policy->addScope(
    new \Delight\PrivacyPolicy\Scope\WebsiteScope('https://www.example.com/', 'example.com')
);

// and/or

$policy->addScope(
    new \Delight\PrivacyPolicy\Scope\PlayStoreAndroidAppScope('com.example.app', 'Example for Android')
);

// and/or

$policy->addScope(
    new \Delight\PrivacyPolicy\Scope\AppStoreIosAppScope('54614917093', 'Example for iOS')
);

Configuring an instance

Privacy policies for machines in formal language

$policy->setMinified(true);

Frequently asked questions

How can I help translate the policy to my language?

If there's a class for your language in the src/Language/ directory already, you can just start working on that file.

If there's no such class yet, simply create a new file for your language:

  1. Copy the template class that extends HumanPrivacyPolicy

  2. Rename the class and file to specify the name of your language (following the common naming scheme)

  3. Update the documentation comment for the class

  4. Replace all occurrences of

    throw new TranslationNotFoundError();

    (except for that in the default case of the switch block) with a return statement specifying the translated string

Why is the HTML output not displayed correctly when using the “Bootstrap” framework?

The “Bootstrap” front-end framework overwrites some of the default CSS properties for definition/description lists. In order to fix how the policy is displayed, you have to reset those properties to their default values or improve them further. Usually, you may want to restrict these resets to the container element of your policy.

Bootstrap 3

dl {
    margin-top: 0;
    margin-bottom: 16px;
}
dl dl {
    margin-left: 24px;
}
dd {
    margin-bottom: 8px;
    margin-left: 0;
}
dl dl dl dd {
    margin-bottom: 0;
}

Bootstrap 4

dl {
    margin-top: 0;
    margin-bottom: 1rem;
}
dl dl {
    margin-left: 1.5rem;
}
dd {
    margin-bottom: 0.5rem;
    margin-left: 0;
}
dl dl dl dd {
    margin-bottom: 0;
}

Disclaimer

This project does not constitute legal advice and is not to be relied upon or acted on as such. Any material presented here is for general information purposes only and may be out of date, incomplete or not suitable for your jurisdiction. You should seek independent legal advice from a qualified professional to guide your decisions around a valid and complete privacy policy.

Contributing

All contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed.

License

This project is licensed under the terms of the MIT License.

More Repositories

1

Android-AdvancedWebView

Enhanced WebView component for Android that works as intended out of the box
Java
2,387
star
2

FreeGeoDB

Free database of geographic place names and corresponding geospatial data
PHP
1,586
star
3

HTML-Sheets-of-Paper

Word processor in your browser using HTML and CSS (for invoices, legal notices, etc.)
CSS
1,208
star
4

PHP-Auth

Authentication for PHP. Simple, lightweight and secure.
PHP
1,073
star
5

Faceless

[UNMAINTAINED] Faceless is where you can talk freely
Java
488
star
6

ShortURL

Bijective conversion between natural numbers (IDs) and short strings
C
381
star
7

Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Java
273
star
8

Android-SimpleLocation

Utility class for easy access to the device location on Android
Java
198
star
9

Knowledge

Random pieces of knowledge — with anecdotes and quotes
189
star
10

PHP-Cookie

Modern cookie management for PHP
PHP
165
star
11

MovieContentFilter

Watch movies with the freedom (not) to filter
PHP
142
star
12

Emoji

[UNMAINTAINED] Emoji (Unicode) and emoticon support for Java and Android
Java
95
star
13

AppRater

Android library that lets you prompt users to rate your application on their appstore (e.g. Google Play)
Java
75
star
14

Android-Languages

Custom language selection and access to language names for Android
Java
74
star
15

PHP-Str

Convenient object-oriented operations on strings
PHP
70
star
16

Android-Commons

[UNMAINTAINED] Reusable components and utilities for Android
Java
69
star
17

AndroidPatternLock

List of all combinations for the Android pattern lock
Java
69
star
18

PHP-FileUpload

Simple and convenient file uploads — secure by default
PHP
63
star
19

PHP-I18N

Internationalization and localization for PHP
PHP
57
star
20

Javadoc-to-Markdown

[UNMAINTAINED] Generate Markdown from your Javadoc, PHPDoc or JSDoc comments
JavaScript
56
star
21

JS-NeuralNetwork

Neural networks in JavaScript. Well-documented and object-oriented.
JavaScript
56
star
22

OpenSoccer

[UNMAINTAINED] Online Soccer Manager
PHP
51
star
23

PHP-DB

Safe and convenient SQL database access in a driver-agnostic way
PHP
47
star
24

Localize

[UNMAINTAINED] Collaborative Translation for Android
PHP
46
star
25

PHP-Router

Router for PHP. Simple, lightweight and convenient.
PHP
38
star
26

Android-Audio

High-level library for efficient playback of sounds and music on Android
Java
35
star
27

htaccess

.htaccess with reasonable defaults for most sites
ApacheConf
29
star
28

PHP-Foundation

Writing modern PHP applications efficiently
Shell
29
star
29

PHP-IDs

Short, obfuscated and efficient IDs for PHP
PHP
27
star
30

Secure-Firefox

Hardening Mozilla Firefox for maximum privacy and security
27
star
31

Android-Identicons

[UNMAINTAINED] Identicons for Android — turn any data into a visual hash
Java
23
star
32

PHP-Random

The most convenient way to securely generate anything random in PHP
PHP
22
star
33

PHP-GitScraper

Downloads entire Git repositories from publicly accessible ".git" folders over HTTP
PHP
20
star
34

PHP-HTTP

Hypertext Transfer Protocol (HTTP) utilities for PHP
PHP
18
star
35

Android-Countries

Provides country codes in accordance with ISO-3166-1 and localized names for each country
Java
18
star
36

PHP-Base64

Simple and convenient Base64 encoding and decoding for PHP
PHP
15
star
37

PHP-BaseConvert

Conversion of arbitrarily large numbers between any two bases or alphabets
PHP
15
star
38

NationSoccer

[UNMAINTAINED] Free 1-vs-1 soccer game for Android
Java
14
star
39

PHP-Temporal

Immutable date and time for PHP with a convenient interface
PHP
13
star
40

Java-Shapefile-Parser

Parses ESRI shapefiles and extracts all spatial/geometric data with attributes
Java
11
star
41

Android-WebRequest

Fluent interface for easy HTTP requests to web servers (GET, POST, PUT or DELETE)
Java
11
star
42

Android-Time

Library for displaying locale-specific time in Android
Java
10
star
43

Android-Tasks

[UNMAINTAINED] Helper classes for recurring and automatic tasks in Android
Java
9
star
44

AndroidDrawableResizer

[UNMAINTAINED] Automatic resizing of Android drawables from one density to all others
PHP
8
star
45

Java-Crash-ID

Generates unique fingerprints for crashes on Android and the JVM
Java
8
star
46

AndroidEmoji-PNG

[UNMAINTAINED] Android emoji from AndroidEmoji.ttf as single icons in PNG format
PHP
8
star
47

Android-KeyValueSpinner

Spinner component that works with normal values but additionally lets you use keys of an arbitrary class
Java
7
star
48

AndroidImageScraper

Extracts all image URLs from a given website ordered by file size
Java
7
star
49

MusikPlayer

Simple Music Player for Windows/Linux/Mac
Java
6
star
50

PHP-Foundation-Core

Core of “PHP-Foundation”
PHP
6
star
51

Android-InfiniteScrolling

Easily add infinite scrolling to ListView or GridView instances in Android
Java
5
star
52

2048

Fork of the popular game "2048"
CSS
5
star
53

Tools-for-Spotify

Tools and utilities for Spotify using the Spotify Web API
PHP
5
star
54

PHP-Alphabets

Sets of digits or characters that may be used for base conversions, encoding and decoding tasks, and input validation
PHP
4
star
55

Weather

Current weather data and hourly weather forecasts
PHP
4
star
56

JS-AbstractStorage

Flexible data storage for JavaScript backed by the Web Storage API
JavaScript
3
star
57

Maintenance

Simple and effective maintenance page for websites
PHP
3
star
58

Android-Monkey

[UNMAINTAINED] Library that generates pseudo-random streams of user input for Android apps
Java
3
star
59

JS-MediaPlayer

Convenient media playback with powerful controls in JavaScript
JavaScript
3
star
60

JS-PRNG

Pseudorandom number generator (PRNG) for JavaScript
JavaScript
2
star
61

2FA-Backup-Sheet

Create backup sheets for any service where you use two-factor authentication (2FA)
Shell
2
star
62

Batch-Renamer

Platform-independent utility for renaming batches of files
PHP
2
star
63

News60

Simple news aggregator and Twitter charts
PHP
2
star
64

PHP-OTP

One-time password (OTP) implementation for two-factor authentication with TOTP in accordance with RFC 6238 and RFC 4226
PHP
2
star
65

Requests

Logging and analysis of requests with optional static responses and redirects
Shell
2
star
66

Simple-ACRA-Storage

[UNMAINTAINED] Simple storage system for crash reports from ACRA on Android
PHP
2
star
67

Twitter-Charts-DE-AT-CH

Inofficial Twitter charts for Germany, Austria and Switzerland
1
star
68

Social-News-Germany

500 most-shared pieces from German online newspapers (March '13 — May '14)
1
star